eDisMax Query Parser

The eDisMax Query Parser is an improved version of the DisMax Query Parser. Along with supporting all the features provided by DisMax Query Parser, it supports the following:

  • Lucene query parser syntax
  • Improved smart partial escaping in the case of syntax errors
  • Improved proximity boosting by using word shingles
  • Advanced stop word handling
  • Improved boost function
  • Pure negative nested queries
  • We can specify which fields the end user is allowed to query, and specify to disallow direct fielded searches

eDisMax Query Parser Parameters: Along with the common parameters, we have these eDisMax Query Parser parameters:

Parameter

Behavior

Default Value

sow

Split on whitespace. Possible values are true and false. Once we set this to true, text analysis will be done for every individual whitespace-separated term.

False

mm.autoRelax Relax the clauses in case of some of the clauses removed like stop words and search wont get impacted due to any clause removal. We need to take care when using the mm.autoRelax parameter because sometimes we may get unpredictable results. Possible values are true and false. False
boost

A multivalued list of strings parsed as queries, with scores multiplied by the score from the main query for all matching documents.

lowercaseOperators
Treats lowercase and and or the same as the operators AND and OR. False
pf2

A multivalued list of fields with optional weights. It's similar to pf, but based on pairs of word shingles.

pf3
A multivalued list of fields with optional weights, based on triplets of word shingles. It is similar to pf, except that instead of building a phrase per field out of all the words in the input, it builds a set of phrases for each field out of each triplet of word shingles.
ps

The ps parameter specifies how many term positions the terms in the query can be off by to be considered a match on the phrase fields.

ps2 Similar to ps but overrides the slop factor used for pf2. If not specified, ps is used.
ps3 Similar to ps but overrides the slop factor used for pf3. If not specified, ps is used.
stopwords Tells Solr to disable StopFilterFactory configured in query analyzer. Possible values are true and false. False will disable StopFilterFactory. True
uf
Specifies which schema fields the end user is allowed to explicitly query.

Allow all fields or uf=*

 

Examples: Searching for music or camera and boosting by popularity.

URL: http://localhost:8983/solr/techproducts/select?defType=edismax&q=music+OR+camera&boost=popularity

Response:

{
"responseHeader":{
"status":0,
"QTime":1,
"params":{
"q":"music OR camera",
"defType":"edismax",
"boost":"popularity"}},
"response":{"numFound":2,"start":0,"docs":[
{
"id":"9885A004",
"name":"Canon PowerShot SD500",
"manu":"Canon Inc.",
"manu_id_s":"canon",
"cat":["electronics",
"camera"],
"features":["3x zoop, 7.1 megapixel Digital ELPH",
"movie clips up to 640x480 @30 fps",
"2.0" TFT LCD, 118,000 pixels",
"built in flash, red-eye reduction"],
"includes":"32MB SD card, USB cable, AV cable, battery",
"weight":6.4,
"price":329.95,
"price_c":"329.95,USD",
"popularity":7,
"inStock":true,
"manufacturedate_dt":"2006-02-13T15:26:37Z",
"store":"45.19614,-93.90341",
"_version_":1583131913780985856,
"price_c____l_ns":32995},
{
"id":"MA147LL/A",
"name":"Apple 60 GB iPod with Video Playback Black",
"manu":"Apple Computer Inc.",
"manu_id_s":"apple",
"cat":["electronics",
"music"],
"features":["iTunes, Podcasts, Audiobooks",
"Stores up to 15,000 songs, 25,000 photos, or 150 hours of video",
"2.5-inch, 320x240 color TFT LCD display with LED backlight",
"Up to 20 hours of battery life",
"Plays AAC, MP3, WAV, AIFF, Audible, Apple Lossless, H.264 video",
"Notes, Calendar, Phone book, Hold button, Date display, Photo wallet, Built-in games, JPEG photo playback, Upgradeable firmware, USB 2.0 compatibility, Playback speed control, Rechargeable capability, Battery level indication"],
"includes":"earbud headphones, USB cable",
"weight":5.5,
"price":399.0,
"price_c":"399.00,USD",
"popularity":10,
"inStock":true,
"store":"37.7752,-100.0232",
"manufacturedate_dt":"2005-10-12T08:00:00Z",
"_version_":1583131913706536960,
"price_c____l_ns":39900}]
}}

In the same way, we can configure all the eDisMax parser parameters and explore the search functionality.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.46.226