Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I search all field in SOLR that contain the keywords,.?

Tags:

field

solr

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,.

like image 451
Praditha Avatar asked Nov 28 '11 10:11

Praditha


People also ask

How do I search for a specific field in Solr?

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.

What is full text search in Solr?

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).

What is phrase search in Solr?

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.

How do I query a collection in Solr?

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.


1 Answers

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

like image 110
kellyfj Avatar answered Oct 06 '22 19:10

kellyfj