Qsol
Home | About | Highlighter | QuickStart | Query Syntax | Download | JavaDoc | Source

Query Syntax

 A brief overview of the default syntax (This is a rough draft and needs work)

Basic Default Operators and Order of Operations (Configurable):

  • 1.'( )' parenthesis : me & (him | her)
  • 2.'!' and not : mill ! bucketloader
  • 3.'~' within : score ~5 lunch : use ord to only find terms in order : score ord~5 lunch
  • 4.'&' and : beat & pony
  • 5.'|' or : him | her
  • Examples:
    bush & chain | cheney
    basketball love ! hate
    (bill | william) ~3 clinton

    The Order of Operations is configurable using the setOpsOrder method on QsolQueryParser.

    Escape - A '\' will escape an operator : m\&m's

    Quotes - an in-order phrase search with or without a specified slop : "holy war sick":3 | "gimme all my cake"

    Range Queries - a query in the form: [beginword TO endword] will perform a range search. Using a bracket is inclusive, a brace exclusive: field({begin TO end]) Just using RNG as an operator also works: field(begin RNG end)

    Field Search - a field search can be performed like this: fieldname(horse | dog)
    A multi-field search is field1,field2(horse | dog)

    Wildcards - * indicates zero or more unknowns and ? indicates a single unknown : old harrt?n | kil?r A wildcard query cannot begin with an unknown.

    Match All - *:* matches every document. *:* ! horse will find every document that does not contain the term horse

    Fuzzy Query : a ` indicates the preceding term should be a fuzzy term : old carrot & devil` may cry

    Term Boost: ^ is the boost operator, term^1.4

    Paragraph/Sentence Proximity Searching: If you have enabled sentence and paragraph proximity searching then the '~' operator may also be used as '~3p' or '~5s' to perform paragraph and sentence proximity searches. Paragraph and sentence proximity searching is implemented using special tokens that must be put into the index at appropriate positions. It is up to you to inject the tokens into the index and then identify them to the QsolParser with setSentenceMarker(String marker) and setParagraphMarker(String marker).

     


    email me