First of all, this module is amazing. Great job!

I'm sorry if I'm missing something obvious here, but how do I actually utilize the ability to search the index? I've set everything up, I can page through the list of fields/records that I've setup in the view, but I don't see a way to execute a search.

Thanks!

CommentFileSizeAuthor
#1 sarnia-views-filters.png70.42 KBbecw
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

becw’s picture

FileSize
70.42 KB

You can use views filters to search the index; if you expose filters, then users can customize the search. Search API's "Search: Fulltext search" will give you a fulltext search box.

Generally, a Solr index will have a tokenized "content" field, and when you put an item into the index, you aggregate all of the items' text content into this field; this field isn't ever displayed to the user, but it allows you to search all of the text at once. The "fulltext search" filter generally points to this field (if you have multiple tokenized text fields on your index, you can point the "fulltext search" views filter at one or more of them).

You can filter on individual fields by selecting the "(Sarnia index): Data" filter; note that if a field is not tokenized, the search will be case-sensitive. Facets also work these days (7.x-1.1-beta and later), so you can do facet-based filtering with FacetAPI + Search API Facets (this is totally external to Views, but does interact appropriately with Views filters and arguments).

dbolser’s picture

I found this difficult too... Can you point us at a step by step tutorial? The tutorial on this page is fantastic, but it ends before describing how to do this.

Cheers,
Dan.

dbolser’s picture

Does this even issue a Solr search? or is it just filtering the whole index using Drupal?

becw’s picture

Search API's "Search: Fulltext search" filter handles fulltext search on the issue. Sarnia provides the "(Sarnia index): Data" filter which applies fq filters to the index.

It would be great to extend the existing documentation to include filters and sorts; if you have things that you've figured out, or especially specific gotchas, please add them to the Sarnia documentation. How you build out a view using Sarnia often depends on your data--and we might have pretty different datasets, so it would be helpful to hear how you ended up doing things in your use case.

dbolser’s picture

Cool, I didn't realize I could edit that page! If/when I get what I need, I'll update the page to explain how I got it :-)

dbolser’s picture

kb_klash’s picture

Ok, so I can now get full text search on that one view. Is there a way to make this search box to show up somewhere in sites main template similar to the search box that is available as a block? Sorry if this is obvious, I'm brand new to Drupal.

Tony Stratton’s picture

From within your view, you can add a block display. And I believe you'll need to enable "Exposed form in block".

kenorb’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.