Log in Help
Print
Homegatewikinutch-solrsolr-appdoc 〉 solr-query-syntax.html
 

Summary of Query Syntax

For every document, we indexed its title and its contents. By default, solr queries are searched only within the document content. Please note that all the query terms are case-insenstive. In other words, the terms GATE, GaTe and gate would return the same results.

Query Type Example Description
Simple Unquoted Query General Architecture

Returns a set of documents with both the terms General and Architecture appearing in them. The order in which these terms appear in the document is not important.

Sequence Query "General Architecture of Text Engineering"

Sequence queries are surrounded with quotes. As the name suggests, this query returns a set of documents with all the terms General Architecture of Text Engineering appearing in the same order as specified.

Field Query title:"visual tutorial"

This type of query allows users to search within specified field. The current version of GATEWiki allows searching within the title, content and the filename fields. Currently, if no field is specified, the query is searched within the title and the content fields. The above query returns a set of documents with their titles containing the phrase visual tutorial

Proximity Query "gate lucene"~10

Returns a set of documents with both the terms gate and lucene appearing within 10 words of each other.

Wildcard Query te?t

? and * are the two wildcards supported by the system. The query returns a set of documents with ? replaced with a single character in the above term. In other words, it could match terms like test and text. Similarly * is replaced with a sequence of more than one character. For instance, de*d can match terms like developed and described. Please note that use of the wildcards at the start of a term is not encouraged.

OR Query google OR bing Returns a set of documents with atleast one of the two terms.
NOT Query GATE NOT UIMA

Excludes a set of documents containing the term after the NOT keyword. In the above example, it will return a set of documents containing the term GATE but not UIMA

Grouping (GATE OR UIMA) demand

It is possible to group queries using the round brackets. For example the above query returns a set of documents containing atleast one of the two terms GATE and UIMA and also containing the token demand

Escaping Special Characters Gate\:

Lucene supports escaping special characters that are part of the query syntax. The current list special characters are

+ - && || ! ( ) { } [ ] ^ " ~ * ? : \

To escape these character use the \ before the character.