Can I run a filtered search on a subset of a collection, or on a group of collections?

Yes, SearchBlox offers a filter query parameter that lets you do a pre-query before you pass your search term, to limit the search results based on certain criteria. In addition to this filter, you can also pass the collection no(col) or collection name (cname) parameter to search on a collection or a group of collections.

You can pass any regular search query through the filter URL parameter, or through a hidden form field.

URL parameters:

Title filter with collection parameter example:

http://localhost:8080/searchblox/servlet/SearchServlet?query=news&filter=title:CNN&cname=news&cname=travel

URL filter example:

http://localhost:8080/searchblox/servlet/SearchServlet?query=news&filter=url:/travel/&col=1&col=2

Hidden form field:

<input type="hidden" name="filter" value="title:CNN" />
<input type="hidden" name="cname" value="news" />
<input type="hidden" name="cname" value="travel" />

-------------------------------------------------------------

<input type="hidden" name="filter" value="url:/travel/" />
<input type="hidden" name="col" value="1" />
<input type="hidden" name="col" value="2" />

 



To learn more about SearchBlox please visit our developer document site https://developer.searchblox.com/docs

Have more questions? Submit a request

Comments