For example, I've keyword for search is: 'Basket Ball'. What is the query that can get all field that contain the 'Basket Ball',.? I've tried to using *:Basket Ball, but it doesn't work,.
If you do not specify a field in a query, Solr searches only the default field. Alternatively, you can specify a different field or a combination of fields in a query. To specify a field, type the field name followed by a colon ":" and then the term you are searching for within the field.
Searching is the most powerful capability of Solr. Once we have the documents indexed in our repository, we can search for keywords, phrases, date ranges, etc. The results are sorted by relevance (score).
Phrase match: A simple way by which we can achieve exact matching in Solr is by using the default string type. It is exact phrase matching. the string is a useful type for facet where we search the index by using the text pulled from the index itself.
You can search for "solr" by loading the Admin UI Query tab, enter "solr" in the q param (replacing *:* , which matches all documents), and "Execute Query". See the Searching section below for more information. To index your own data, re-run the directory indexing command pointed to your own directory of documents.
The default search field (since 3.6) is now defined in solrconfig.xml
e.g. In the solrconfig.xml that ships with Solr configsets directory you will see something like
<initParams path="/update/**,/query,/select,/tvrh,/elevate,/spell">
<lst name="defaults">
<str name="df">allText</str>
</lst>
</initParams>
You can change allText
to yourDefaultSearchFieldName
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With