concept multiple field in category search

appears as: multiple fields
Relevant Search: With applications for Solr and Elasticsearch

This is an excerpt from Manning's book Relevant Search: With applications for Solr and Elasticsearch.

Being a fairly new relevance engineer, you’ll start with a basic application of Elasticsearch’s multi_match query. This is Elasticsearch’s Swiss Army knife for constructing queries across multiple fields. Because most search problems involve searching multiple fields, it’s where many start with a relevance solution. A common initial pass at a search relevance solution is to attempt to construct a multi_match query that lists the fields to be searched along with a few boosts (specified with the ^ symbol). Boosting is the act of adding or multiplying to a relevance score with a constant factor, query, or function. In this case, boosting is simple; you boost the title score by the constant 10 in an effort to tell the search engine about the relative importance of the field.

Another way you’ll sidestep the precision/recall trade-off is through searching over multiple fields, each with different forms of analysis. It may seem that forms of analysis are mutually exclusive: analyze via standard analysis or English stemming analysis or phonetic analysis. But you can use all of these together if you’d like. It’s common to treat the same text differently with different analyzers, placing the result in different fields. In chapter 5 and on, you’ll see how multiple fields can lend their own signals to improve the overall ranking function and improve the precision/recall trade-off.

Figure 5.5. Match query over multiple fields (multi_match). Each field analyzes the search string and runs a Boolean OR query.
Lucene in Action, Second Edition

This is an excerpt from Manning's book Lucene in Action, Second Edition.

A document is simply a container for multiple fields; Field is the class that holds the textual content to be indexed.

  • Using a variant of QueryParser that searches multiple fields at once
  • Listing 5.7. MultiFieldQueryParser, which searches on multiple fields at once