Solr faceted search - how to specify multiple fields in the Solr user interface?

I am new to solr and tying my hands to solr. Can someone here explain how to specify multiple facet fields for a given search.

I use Solr Admin UI / request ink, and this allows me to specify only one field. However, I would like to plunge into several fields, such as the regional industry exchange, etc. In my search in the company.

I went through the solr wiki and the corresponding doc links as shown below http://docs.lucidworks.com/display/solr/Query+Screen

but none of them explain how to specify multiple fields. I want to create something like a regular Amazon / Walmart, etc. Search ui, which provides many aspects and calculations when trying to search for a product on my planned cmpany search page.

+4
source share
5 answers

You can request multiple facet fields. Just write using the syntax:

.../select?q=&facet=true&facet.field=<field1>&facet.field=<field2> 
+9
source

When you search the Solr Query user interface, it displays the actual URL that is sent to Solr above the result pane. Click on this URL and it will open a new window in your browser for that URL. From there, you can add additional parameters to the URL to receive facts on several fields by adding additional entries &facet.field=<your field> .

For details, see Mirror Parameterization Parameters for more information and other parameters.

+2
source

The Solr Admin user interface allows you to specify several facet fields, i.e. csv field in facet.field parameter. You need to check the facet checkbox, after which you will get additional options.

If you request Solr using a link, the link should look like facet=true&facet.field=field1&facet.field=field2 .

+1
source

Are you looking for json.facet

It is available from solr 5 (some additional features are available from solr 6). This basically means that you can insert facet search parameters via json in the URL.

It looks like this (live example):

 &facet=true&json.facet={"filed1":{"type":"terms","field":"filed1","limit":2000},"filed2":{"type":"terms","field":"filed2","limit":2000}} 

There is also a shorter version:

 &facet=true&json.facet={"field1":{"terms":"field1"},"field2":{"terms":"field2"}} 

You can find more information here.

0
source

Source: https://habr.com/ru/post/1486048/


All Articles