3

So I am working on my first mid sized D7 projects and it needs some rather advanced searching capabilities (at least advanced for me). I've installed Solr, created a server and an index with the Search API, and created a search page. So far so good... everything works according to what you'd expect, and it even has facets, which is something I really wanted for this site. The problem is that this seems to be pretty much my ceiling... and I would like to change some things. For instance:

  1. I would like to be able to search through my indexed taxonomies. Right now I can only search the node titles and descriptions and I have a bunch of taxonomies which is what I really want to search through.
  2. I would like the users to be able to search from a search form in my home. Right now the core search is all I have in my front page, and if I want to use the Solr server I have to go to my search page. Ideally I want the user to enter a search term in the search form, to be redirected to the results page, and just there for him to see all the facets to further filter the results... linkedin style.

How would you guys accomplish something like that?

Edit:

Seems it seems I haven't stated clearly what I intend to do I'll try to upload some pics regarding point 1:

admin/config/search/search_api/index/node_search/fields

These are the fields I choose to be indexed! These are the fields I choose to be indexed

admin/config/search/search_api/page/search/edit If you see I can only choose "Title" and "description" from the fields to search from... so if I search for a taxonomy term which is not in any title or description, I get nothing

If you see I can only choose "Title" and "description" from the fields to search from... so if I search for a taxonomy term which is not in any title or description, I get nothing. I would like to make the taxonomies in the first picture searchable... which is why I indexed them in the first place.

Edit 2:

I've finally managed to get the core search form to work with Solr following this tut(http://web3us.com/drupal6/how-create-web-site-handbook/apache-solr-drupal/apache-solr-3-drupal-7-turtorial-screen-shots) but I still don't know how to display the fields I want in the search results. Right now the results look like this:

enter image description here

And I would like each of them to look as the Teasers I've configured in my "Restaurant" content type (which are the nodes that I've set Solr to index)

  • Have you taken a look at Search API and Search API Solr? (I've never used them, so can't speak to how good they may be.) – Andy May 21 '12 at 16:29
  • 1
    That's exactly what I'm using and having problems with... – la_f0ka May 21 '12 at 22:10
  • Sorry, missed that in Q – Andy May 22 '12 at 8:04
  • I have deleted my answer, as your screenshots now speak a very different story than I gleaned from your original question. Not sure why your fields are not showing in the search pages. but for the second question, see the issue queue drupal.org/node/1235026 – user842 May 22 '12 at 20:38
  • mmm... do you know what this could be all about? >SearchApiException: The "Facets block" display cannot be used with a view for Content. Please only use this display with base tables representing search indexes. in SearchApiViewsFacetsBlockDisplay->getFieldOptions() (line 123 of /Users/muayguy/www/rhys/sites/all/modules/search_api/contrib/search_api_views/includes/display_facet_block.inc). Every time I try to make a "fitting search view" I get that – la_f0ka May 22 '12 at 21:03
3

Question #1: Go to admin/config/search/apachesolr/settings and select 'Bias'. There you can set up the weights next to the terms you want to search through. Perhaps they're on 'Omit' or something like that...

Question #2: Go to the search settings page and make Apache solr search be your default search. That way, when users type in keywords in your regular search form, they will automatically use your apachesolr search. admin/config/search/settings

enter image description here

Let us know if that worked for you!

  • Thanks, I eventually got it to work. Do you know how to change the search results thought? To actually display the teasers instead of just the titles and the small part of the text where the keywords (searched terms) were found? – la_f0ka May 26 '12 at 15:55
  • Well, if you go to your content type and go to the "Manage Display" tab, look at the 'Custom Display Settings' section and expand it (it's collapsed by default). If you check the 'Search result' checkbox and save, it should let you customize what fields are returned in the search results. I've never tried this, but it seems promising! – Boriana Ditcheva May 29 '12 at 13:10
  • is.gd/e7fBlh – la_f0ka May 29 '12 at 19:57
  • .... but it doesn't seem to be using that display in my search results... :( – la_f0ka May 29 '12 at 20:16
  • 1
    no problem...for what I've found so far it seems it could be a D7 bug (drupal.org/node/1166114) – la_f0ka May 29 '12 at 20:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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