Pre Exam Test Practice
Ask a Question
Advertise on boostr.in
Organizational Research By
Surprising Reserch Topic
boostr.in questions - Question:custom query syntax for querying its indexes?
Search for word "foo" in the title field.
Search for phrase "foo bar" in the title field.
Search for phrase "foo bar" in the title field AND the phrase "quick fox" in the body field.
title:"foo bar" AND body:"quick fox"
Search for either the phrase "foo bar" in the title field AND the phrase "quick fox" in the body field, or the word "fox" in the title field.
(title:"foo bar" AND body:"quick fox") OR title:fox
Search for word "foo" and not "bar" in the title field.
Search for any word that starts with "foo" in the title field.
Search for any word that starts with "foo" and ends with bar in the title field.
Note that Lucene doesn't support using a * symbol as the first character of a search.
Lucene supports finding words are a within a specific distance away.
Search for "foo bar" within 4 words from each other.
Note that for proximity searches, exact matches are proximity zero, and word transpositions (bar foo) are proximity 1.
A query such as "foo bar"~10000000 is an interesting alternative to foo AND bar.
Whilst both queries are effectively equivalent with respect to the documents that are returned, the proximity query assigns a higher score to documents for which the terms foo and bar are closer together.
The trade-off, is that the proximity query is slower to perform and requires more CPU.
Solr DisMax and eDisMax query parsers can add phrase proximity matches to a user query.
Range Queries allow one to match documents whose field(s) values are between the lower and upper bound specified by the Range Query. Range Queries can be inclusive or exclusive of the upper and lower bounds. Sorting is done lexicographically.
mod_date:[20020101 TO 20030101]
Solr's built-in field types are very convenient for performing range queries on numbers without requiring padding.
Sep 13, 2013
Sep 12, 2013
to add a comment.
Related Hot Questions
Government Jobs Opening