Grooper Help - Version 25.0
25.0.0017 2,127
  • Overview
  • Help Status

Lucene Phrase

Lucene Query Grooper.GPT

Represents a phrase-based search expression for AI Search queries.

Remarks

A Lucene Phrase is used to construct search queries that match phrases or terms appearing together in document text or field values. Phrase queries are essential for finding multi-word expressions, quoted text, or sequences of words that must appear in a specific order or proximity.

Purpose and Usage

  • Use a Lucene Phrase to search for documents containing a specific sequence of words, such as names, product titles, or quoted phrases.
  • Supports advanced options such as proximity (words appearing near each other) and boosting (ranking results higher when the phrase is present).
  • Can be combined with fielded search, boolean logic, and other Lucene Query types for complex search scenarios.

Lucene Syntax Examples

Basic Phrase Search:
"recently renovated"
Returns documents containing the exact phrase "recently renovated".

Fielded Phrase Search:
category:"budget hotel"
Returns documents where the "category" field contains the phrase "budget hotel".

Proximity Search:
"hotel airport"~5
Returns documents where "hotel" and "airport" appear within five words of each other.

Boosting:
"luxury suite"^2
Returns documents containing "luxury suite" and boosts their relevance by a factor of 2.

Boolean Combination:
"recently renovated" AND "pet friendly"
Returns documents containing both phrases.

Grouped/Order of Operations:
("recently renovated" OR "newly remodeled") AND "pet friendly"
Returns documents containing "pet friendly" and either "recently renovated" or "newly remodeled".

Configuration Guidance

  • Set the 'Phrase' property to the exact sequence of words you want to match.
  • Use the 'Proximity' property to allow words in the phrase to appear within a certain distance of each other, rather than requiring an exact match.
  • Use the 'Boost Factor' property to increase the relevance of documents containing the phrase.
  • Combine with the 'Field Name' and 'Not' properties (inherited from Lucene Query) to further refine your search.

Best Practices

  • Use phrase queries for names, addresses, or other multi-word values where word order and adjacency matter.
  • Adjust proximity for flexible matching in cases where words may be separated by other content.
  • Apply boosting to prioritize key phrases in ranking, especially when multiple search terms are used.

Example Scenarios

  • Find documents containing the phrase "recently renovated":
    "recently renovated"
  • Find documents where hotel and airport appear within five words of each other:
    "hotel airport"~5
  • Boost results containing the phrase luxury suite:
    "luxury suite"^2

Properties

NameTypeDescription
Notification