liveBook · Manning

QueryParser

As explained in MongoDB 8.0 in Action, Third Edition

QueryParser is a Lucene component that parses query syntax and converts it into executable search queries.

QueryParser interprets Lucene query syntax and converts it into executable search commands for full-text search. It supports logical operators such as AND, OR, and NOT. section 11.2

Supported query forms include:

  • term and phrase searches locate individual words or exact word sequences. section 11.2
  • wildcard, fuzzy, and proximity searches handle partial words, spelling variation, and nearby terms. section 11.2
  • range searches filter numbers, dates, and other ordered values. section 11.2

Searching vendor records

A query such as "Mobile Food Vendor - 881 PALMER AVE" is divided into searchable tokens. Matching those tokens against the inverted index can return only the document containing both the sector and street terms, with a high score for the precise match. section 11.2

How MongoDB 8.0 in Action, Third Edition covers it

How deep it goes
Explains logical operators and query forms, including inverted-index matching, term positions, and edit-distance fuzzy matching.
Examples
Uses vendor-sector and street-address queries, two sample documents, and an inverted-index table.
What you can do after
Apply Lucene query syntax to submit term, phrase, wildcard, fuzzy, proximity, and range searches.
How it connects
Connects logical operators with inverted indexes, phrase queries, wildcard queries, fuzzy queries, proximity queries, and range queries.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of MongoDB 8.0 in Action, Third Edition. The section links point to the parts of the book it draws on.