: I am trying to search a solr index and I don't understand whether the query
: has to conform to a lucene query structure

Fundementally, there is no single query structure -- anyone can write a
request handler that parses any syntax they want.

Practically speaking, Solr comes with two request handlers for doing
searches out of the box: the StandardREquestHandler supports the lucene
query syntax, with some tweaks which are documented in the wiki...
   http://wiki.apache.org/solr/StandardRequestHandler
   http://wiki.apache.org/solr/SolrQuerySyntax
...and the DisMaxRequestHandler which has a much more limited syntax, only
the plus, minus, nad quote characters have special meaning.  this is also
described in the wiki (although there aren't any good examples)
   http://wiki.apache.org/solr/DisMaxRequestHandler

: maybe even generated by the lucene api  such as QueryParser. If that is the

i'm not sure i follow you there ... the lucene QueryParser doesn't
generate query strings ... it parses them, but i think what you mean is
"can i give solr any expression i can give the lucene QueryParser ... the
answer is yes, with the small caveat that depending on the FieldType you
use you might need to format the tokenshemselves slightly differnetly (ie:
if you are using Solr's DateField then your dates have to be in the
appropriate format, not the format you might be use to from Lucene's
QueryParser/DateTools support.

: Can someone ,please, direct me to explicit examples of searching where the
: query is more complex than a single token in each field?

The tutorial has about a dozen differnet example search urls that
excercise several features of the standard request handler query
parsing...

video
name:video
+video +price:[* TO 400]
id:SP2514N
power-shot
"1 gigabyte"

Specificly, to your question of "more complex than a single token in each
field" that would be any of the examples from the lucene query parser
syntax doc...

title:"The Right Way" AND text:go
title:"Do it right" AND right
title:(+return +"pink panther")




-Hoss

Reply via email to