Hi Hoss,

Maybe I'm missing something, but I tried this and got 1 hit:


http://localhost:8983/solr/db/select?q=title:(Apache%20Solr%20Notes)&fl=id%2Cscore%2Ctitle&wt=xml&indent=true&q.op=AND

Than I tried this and got 0 hit:


http://localhost:8983/solr/db/select?q={!field%20f=title%20v=$qq}&qq=Apache%20Solr%20Notes&fl=id%2Cscore%2Ctitle&wt=xml&indent=true&q.op=AND

It looks to me that "f" with "qq" is doing phrase search, that's not what I
want.  The data in the field "title" is "Apache Solr Release Notes"

I looked over the links you provided and tried out the examples, in each
case if the user-typed-text contains any reserved characters, it will fail
with a syntax error (the exception is when I used "f" and "qq" but like I
said, that gave me 0 hit).

If you can give me a concrete example, please do.  My need is to pass to
Solr the text "Apache: Solr Notes" (without quotes) and get a hit as if I
passed "Apache\: Solr Notes" ?

Thanks

Steve

On Thu, Apr 16, 2015 at 5:49 PM, Chris Hostetter <hossman_luc...@fucit.org>
wrote:

>
> : The summary of your email is: client's must escape search string to
> prevent
> : Solr from failing.
> :
> : It would be a nice addition to Solr to provide a new query parameter that
> : tells it to treat the query text as literal text.  Doing so, means you
> : remove the burden placed on clients to understand and escape reserved
> Solr
> : / Lucene tokens.
>
> i'm a little lost as to what exactly you want to do here -- but i'm going
> to focus on your thesis statement here, and assume that you want to
> search on a literal piece of text and you don't want to have to worry
> about escaping any characters and you don't wantsolr to treat any part of
> the query string as special.
>
> the only way something like that works is if you only want to search a
> single field -- searching multiple fields, searching multiple clauses,
> etc... none of those types of options make sense in this context.
>
> people have already mentioned the "term" parser -- which is fine ifyou
> want to serach for exactly one literal term, but as a more generally
> solution, what people usualy want, is the "field" parser -- which works
> better with TextFields in general...
>
>
> https://cwiki.apache.org/confluence/display/solr/Other+Parsers#OtherParsers-FieldQueryParser
>
> Just like the comment you've seen about the "term" parser needing an "f"
> localparam to specify the field, the same is true for the "field" parser.
> but variable refrences make this trivial to specify -- instead of using
> the full "{!field f=myfield}Foo Bar" syntax in your q param, you can use
> an alternate param ("qq" is common in many examples) for the raw data from
> the user...
>
> q={!field f=myfield v=$qq} & qq=whatever your usertypes
>
>
>
> https://cwiki.apache.org/confluence/display/solr/Local+Parameters+in+Queries
>
>
> -Hoss
> http://www.lucidworks.com/
>

Reply via email to