Re: Differentiating user search term in Solr

2015-04-20 Thread Walter Underwood
I’ve been wanting a “free text” query parser for a while. We could build some cool stuff on that: auto-phrasing, entity extraction and weighting, CJK tokenization, … For reference, here are some real-world user queries I have needed to deal with. These have exactly matched content. * +/- * .ha

Re: Differentiating user search term in Solr

2015-04-20 Thread Steven White
Hi Erick, I think you missed my point. My request is, Solr support a new URL parameter. If this parameter is set, than EVERYTHING in q is treated as raw text (i.e.: Solr will do the escaping vs. the client). Thanks Steve On Mon, Apr 20, 2015 at 1:08 PM, Erick Erickson wrote: > How does that

Re: Differentiating user search term in Solr

2015-04-20 Thread Erick Erickson
How does that address the example query I gave? q=field1:whatever AND (a AND field:b) OR (field2:c AND "d: is a letter followed by a colon (:)"). bq: "Solr will treat everything in the search string by first passing it to ClientUtils.escapeQueryChars()." would incorrectly escape the colons after

Re: Differentiating user search term in Solr

2015-04-20 Thread Steven White
Hi Erick, I didn't know about ClientUtils.escapeQueryChars(), this is good to know. Unfortunately I cannot use it because it means I have to import Solr classes with my client application. I want to avoid that and create a lose coupling between my application and Solr (just rely on REST). My sug

Re: Differentiating user search term in Solr

2015-04-20 Thread Erick Erickson
Steve: In short, no. There's no good way for Solr to solve this problem in the _general_ case. Well, actually we could create parsers with rules like "if the colon is inside a paren, escape it). Which would completely break someone who wants to form queries like q=field1:whatever AND (a AND field

Re: Differentiating user search term in Solr

2015-04-20 Thread Steven White
Hi Shawn, If the user types "title:(Apache: Solr Notes)" (without quotes) than I want Solr to treat the whole string as raw text string as if I escaped ":", "(" and ")" and any other reserved Solr keywords / tokens. Using dismax it worked for the ":" case, but I still get SyntaxError if I pass it

Re: Differentiating user search term in Solr

2015-04-20 Thread Shawn Heisey
On 4/20/2015 7:41 AM, Steven White wrote: > In my application, a user types "Apache Solr Notes". I take that text and > send it over to Solr like so: > > > http://localhost:8983/solr/db/select?q=title:(Apache%20Solr%20Notes)&fl=id%2Cscore%2Ctitle&wt=xml&indent=true&q.op=AND > > And I get a hit on

Re: Differentiating user search term in Solr

2015-04-20 Thread Steven White
Hi Hoss, Thanks for that lengthy feedback, it is much appreciated. Let me reset and bear in mind that I'm new to Solr. I'm using Solr 5.0 (will switch over to 5.1 later this week) and my need is as follows. In my application, a user types "Apache Solr Notes". I take that text and send it over

Re: Differentiating user search term in Solr

2015-04-17 Thread Chris Hostetter
: 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" if you don't wnat phrase queries then you don't want pharse queries and that's fine -- but it wasn't clear from any of your original emails because

Re: Differentiating user search term in Solr

2015-04-16 Thread Steven White
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=Ap

Re: Differentiating user search term in Solr

2015-04-16 Thread Chris Hostetter
: 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 unders

Re: Differentiating user search term in Solr

2015-04-16 Thread Steven White
Thanks for trying Shawn. Looks like I have to escape the string on my client side (this isn't a clean design and can lead to errors if not all reserved tokens are not escaped). I hope folks from @dev are reading this and consider adding a parameter to tell Solr the text is raw-text. Steve On Th

Re: Differentiating user search term in Solr

2015-04-16 Thread Shawn Heisey
On 4/16/2015 10:18 AM, Shawn Heisey wrote: > On 4/16/2015 10:10 AM, Steven White wrote: >> I don't follow what the "f" parameter is. Do you have a link where I can >> read more about it? I found this >> https://wiki.apache.org/solr/HighlightingParameters and >> https://wiki.apache.org/solr/Simple

Re: Differentiating user search term in Solr

2015-04-16 Thread Shawn Heisey
On 4/16/2015 10:10 AM, Steven White wrote: > I don't follow what the "f" parameter is. Do you have a link where I can > read more about it? I found this > https://wiki.apache.org/solr/HighlightingParameters and > https://wiki.apache.org/solr/SimpleFacetParameters but i"m not sure this is > what y

Re: Differentiating user search term in Solr

2015-04-16 Thread Steven White
I don't follow what the "f" parameter is. Do you have a link where I can read more about it? I found this https://wiki.apache.org/solr/HighlightingParameters and https://wiki.apache.org/solr/SimpleFacetParameters but i"m not sure this is what you mean (I'm not doing highlighting for faceting). T

Re: Differentiating user search term in Solr

2015-04-16 Thread Shawn Heisey
On 4/16/2015 9:37 AM, Steven White wrote: > What is "term" in the "defType=term", do you mean the raw word "term" or > something else? Because I tried that too in two different ways: Oops. I forgot that the term query parser (that's what "term" means -- the name of the query parser) requires tha

Re: Differentiating user search term in Solr

2015-04-16 Thread Steven White
What is "term" in the "defType=term", do you mean the raw word "term" or something else? Because I tried that too in two different ways: Using correct Solr syntax: http://localhost:8983/solr/db/select?q={!q.op=AND%20df=text}%20solr%20sys&fl=id%2Cscore%2Ctitle&wt=xml&indent=true&defType=term Th

Re: Differentiating user search term in Solr

2015-04-16 Thread Shawn Heisey
On 4/16/2015 7:49 AM, Steven White wrote: > defType didn't work: > > > http://localhost:8983/solr/db/select?q={!q.op=AND%20df=text%20solr%20sys&fl=id%2Cscore%2Ctitle&wt=xml&indent=true&defType=lucene > > Gave me error: > > org.apache.solr.search.SyntaxError: Expected identifier at pos 27 > str=

Re: Differentiating user search term in Solr

2015-04-16 Thread Steven White
defType didn't work: http://localhost:8983/solr/db/select?q={!q.op=AND%20df=text%20solr%20sys&fl=id%2Cscore%2Ctitle&wt=xml&indent=true&defType=lucene Gave me error: org.apache.solr.search.SyntaxError: Expected identifier at pos 27 str='{!q.op=AND df=text solr sys' Is my use of defType corr

Re: Differentiating user search term in Solr

2015-04-16 Thread Shawn Heisey
On 4/16/2015 7:09 AM, Steven White wrote: > I cannot use escapeQueryChars method because my app interacts with Solr via > REST. > > 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 param

Re: Differentiating user search term in Solr

2015-04-16 Thread Steven White
Thanks Shawn. I cannot use escapeQueryChars method because my app interacts with Solr via REST. 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 tex

Re: Differentiating user search term in Solr

2015-04-15 Thread Shawn Heisey
On 4/15/2015 3:54 PM, Steven White wrote: > Hi folks, > > If a user types in the search box (without quotes): "{!q.op=AND df=text > solr sys" and I take that text and build the URL like so: > > http://localhost:8983/solr/db/select?q={!q.op=AND%20df=text%20solr%20sys&fl=id%2Cscore%2Ctitle&wt=xml&ind

Differentiating user search term in Solr

2015-04-15 Thread Steven White
Hi folks, If a user types in the search box (without quotes): "{!q.op=AND df=text solr sys" and I take that text and build the URL like so: http://localhost:8983/solr/db/select?q={!q.op=AND%20df=text%20solr%20sys&fl=id%2Cscore%2Ctitle&wt=xml&indent=true This will fail with "Expected identifier"