2

I'm completely new to Solr and roughly understand the basic principles of setting up a search engine but not (yet) the specifics.

I'm beginning work on a site which will display search results from the content in the site (Articles), however, we also want to allow visitors to use the same search form to return - in the same page - results from both our own site, and from other external sites which could be indexed in Solr but are not Drupal sites.

Is this even possible or am I wasting my time? Many thanks for any insights.

4
  • Yes, it is possible. - if this is not satisfying as an answer, please refine your question. Actually if this is the answer you are looking for, I doubt if your question is that useful.
    – Mołot
    Commented Dec 2, 2014 at 15:36
  • drupal.org/project/apachesolr_multisitesearch
    – wonder95
    Commented Dec 2, 2014 at 18:29
  • 1
    Thank you very much. A question remains however - it is not clear (at least not to me) whether MultiSite Search to which you refer allows you to search on multiple sites including non-Drupal sites. This discussion suggests that it is, but the discussion is quite old and the most interesting links are dead.
    – Martin K
    Commented Dec 3, 2014 at 9:24
  • @MartinK did you ever reach a conclusion on how to index external non-Drupal sites? Am seeking a Drupal 8 solution to this problem now. Commented May 30, 2017 at 15:49

1 Answer 1

2
+100

Solr can be thought of as a document oriented database , it has a schema based, and a schema-less mode.

When used from the drupal module it uses a schema.xml file to specify what it expects to find in the documents (and hence index).

so if you go down that option one way you could search across the external domain and the drupal site is index the external domain to that schema, extending it where necessary

if you've got a title field in both sets of data , then it will index title that way. if your external site has different fields you could add them to the schema you'll want to define a minimal shared set that documents from either site share, to make themeing, and UX easier.

The process I would probably go for is

  1. create a schema that covers both sources of data
  2. configure Drupal to use that schema and index the site
  3. index the external site (Solr 5 has a crawler now, or might just be easier to build a CSV file with curl)

that would get you to a place where you can search across the 2 sites from the Drupal search. It would be a case of getting the theme/markup right to represent offsite vs onsite results.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.