3

Configuration: I am using Drupal 7, search api and search api solr.

Description & problem: I am trying to use search api and solr search(as a back end) to search for nodes. I have a solr server running in localhost:8983/solr/admin/. I create a solr server inside drupal configuration, then I create a node index using this server and I index the field: title. The index runs successfully and indexes my 11 articles.

Then i create a search page using search_api_page to test out the searching functionality. Result: I get "Your search yielded no results" when searching for a word in the title of the articles (the word exists in the titles)

I am starting to become desperate here. The index is working correctly but neither through a search page nor through a view can I access the results. It says there are none :O Any ideas?

EDIT: I can query by hand, if i go to localhost:8983/solr/select/?q=spell:test then I get all the articles with the word "test" in their title. Also a ?q= will show all the indexed articles

5
  • try going here admin/config/search/apachesolr/settings/yourEnvironmentName/bias and set the weight to each field.
    – saadlulu
    Commented Mar 13, 2013 at 13:58
  • try to make sure that the title and body fields are not 'ommitted'
    – saadlulu
    Commented Mar 13, 2013 at 14:00
  • thx for the comment but I can't find the 'here' you are talking about. In any case the title is indexed, shouldn't i be able to see the titles when i search? Commented Mar 13, 2013 at 14:26
  • go to Configuration->Apache Solr search->Settings->Bias->Field biases. The title is indexed but that does not mean it is not omitted if it has no weight.
    – saadlulu
    Commented Mar 13, 2013 at 14:31
  • i think you are talking about drupal.org/project/apachesolr here. I am using drupal.org/project/search_api_solr plus drupal.org/project/search_api. As I can't make my configuration work I'll have to use the native apache solr module you are talking about, it seems Commented Mar 13, 2013 at 15:10

2 Answers 2

1

There is a 'solr-devel' module to help http://drupal.org/project/solr_devel.

Make sure that the query works directly in the solr native search page. Isolate the drupal side this way.

Make sure that you have updated schema.xml and solrconfig.xml with the ones that come with the module as per the module README.txt. Reindex.

Move apache-solr-1.4.1/example/solr/conf/schema.xml and rename it to something like schema.bak. Then move the solr-conf/solr-1.4/schema.xml that comes with this Drupal module to take its place.

Similarly, move apache-solr-1.4.1/example/solr/conf/solrconfig.xml and rename it like solrconfig.bak. Then move the solr-conf/solr-1.4/solrconfig.xml that comes with this module to take its place.

2
  • the schema.xml and the solarconfig.xml are already the correct ones, i updated them again. I am not using the 1.4 but the 3.6 version Commented Mar 13, 2013 at 12:47
  • and the query works by hand on the server, but not through Drupal Commented Mar 13, 2013 at 15:14
1

I've setup Apache Solr successfully a few times, here's a look at my setup, please excuse the squiggles, I've redacted certain parts to keep client anonymity.

I'm going to assume you're using the default Solr config found in the latest Search API Solr module (derivatives of this have always worked for me).

enter image description here

You should have both a Server and Index setup with Apache Solr like the above, there should be the message "The Solr server could be reached" also like pictured.

enter image description here

Make sure you have filled all fields out correctly if Drupal is having trouble reaching the Solr server, for example if you choose https, but haven't customised the default Solr config to enable https then it will not work.

enter image description here

Now it's important to make sure you're indexing at least one field as 'fulltext' otherwise you can't perform any free text searches. It's usually a good idea to have Title indexed as fulltext.

enter image description here

I don't know how you have your Search API pages configured, but I personally like to do it via views (because views is awesome). Make a view using your Index that you created.

In the newly created view add an exposed filter of type Search: Fulltext.

There's a couple of advantages with using Views so I'd definitely recommend this way over search pages. Let me know how you get on.

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.