You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by "Nemani, Raj" <Ra...@turner.com> on 2012/09/08 01:04:16 UTC

Term searches with colon(:)

All,

I was wondering if anybody has run into this issue before. Solr is not
returing any search results for word that contain  colon ( : ) in it
when we perform a term search containing colon.  We do escape this
correctly, I believe as shown in the sample (taken from tomcat logs)

 

Sep 06, 2012 11:30:01 PM org.apache.solr.core.SolrCore execute

INFO: [] webapp=/XXXXX path=/select
params={q=+(*\:*)+&rows=100&version=2.2} hits=0 status=0 QTime=0 

 

On the other hand if we prefix the term with a field name, we get
correct results as shown below

 

Sep 06, 2012 11:30:29 PM org.apache.solr.core.SolrCore execute

INFO: [] webapp=/XXXXX path=/select
params={q=(+description:*\:*)&rows=100&version=2.2} hits=1 status=0
QTime=0 

 

Did anybody encounter this behavior before?

 

Any help is appreciated and Thank you in advance

 

Raj

 

 

 


Re: Term searches with colon(:)

Posted by Jack Krupansky <ja...@basetechnology.com>.
Please provide the following information:

1. Which Solr release are you using?
2. The field type(s) that you are using. Give the full field type (not all 
of them, just what you are using.)
3. Add &debugQuery=true to your colon request to see what query gets 
generated - the "parsedquery".
4. A small amount of indexed text that has the colons you think should 
match.

If you could reproduce your problem using the standard Solr example with the 
minimal changes, that would be most helpful. For example, a curl command to 
add a text document that has the colon in a field and where the query fails.

As a general rule, you shouldn't expect to see special characters or 
punctuation in "text" fields. In string fields, yes.

That said, the StandardTokenizer does in fact keep some special characters, 
some of the time. Colon is one that is preserved some of the time.

-- Jack Krupansky

-----Original Message----- 
From: Nemani, Raj
Sent: Friday, September 07, 2012 7:04 PM
To: solr-user@lucene.apache.org
Subject: Term searches with colon(:)

All,

I was wondering if anybody has run into this issue before. Solr is not
returing any search results for word that contain  colon ( : ) in it
when we perform a term search containing colon.  We do escape this
correctly, I believe as shown in the sample (taken from tomcat logs)



Sep 06, 2012 11:30:01 PM org.apache.solr.core.SolrCore execute

INFO: [] webapp=/XXXXX path=/select
params={q=+(*\:*)+&rows=100&version=2.2} hits=0 status=0 QTime=0



On the other hand if we prefix the term with a field name, we get
correct results as shown below



Sep 06, 2012 11:30:29 PM org.apache.solr.core.SolrCore execute

INFO: [] webapp=/XXXXX path=/select
params={q=(+description:*\:*)&rows=100&version=2.2} hits=1 status=0
QTime=0



Did anybody encounter this behavior before?



Any help is appreciated and Thank you in advance



Raj








RE: Term searches with colon(:)

Posted by "Nemani, Raj" <Ra...@turner.com>.
Sorry for not being clear.

Yes, I am trying to do a wildcard search for terms that contain a colon
in the text (ie: "foo:bar") in the filed list mentioned in the default
requesthandler that I posted earlier.  Description is one of those
fields.  Mpg is another field.  I have not included the entire default
field list for brevity's sake.

The *s  in my queries that I have included are part of the actual solr
query (to denote wildcards as you said earlier).
Hope I am clear this time.

Thank you again for your help.

Raj


-----Original Message-----
From: Chris Hostetter [mailto:hossman_lucene@fucit.org] 
Sent: Tuesday, September 11, 2012 3:10 PM
To: solr-user@lucene.apache.org
Subject: RE: Term searches with colon(:)


: Thank you for the reply and help.  The description field is part of
the
: defaultHandler's eDisMax search list (qf):
	...
: Similar queries for other escaped characters in "description" using
term
: search return correctly as shown from the logs correctly.

Ok ... but you haven't really answered my main question -- what are you
trying to match?  are you trying to search for the literal term "*:*" in
the description field? are you trying to do a wildcard search for terms
that contain a colon in the middle (ie: "foo:bar"), are you trying to
match all documents in the description field?

you've said it doesn't match anything, but you haven't explain what you
expect it to match

(Actually .. lemme back up and ask a silly question -- are the "*" 
characters in your email actaully part of the query you are sending to
solr, or is that just an artifact of your mail client translating bold
or highlighted characters into "*" when converting to plain text?)

: what are you expecting that query to match?  because by backslash
: escpaing the colon, what you are asking for there is for Solr to
search
: for the literal string "*:*" in your default search field
(afterwhatever
: query time analysis is configured on your default search field)


-Hoss

RE: Term searches with colon(:)

Posted by Chris Hostetter <ho...@fucit.org>.
: Thank you for the reply and help.  The description field is part of the
: defaultHandler's eDisMax search list (qf):
	...
: Similar queries for other escaped characters in "description" using term
: search return correctly as shown from the logs correctly.

Ok ... but you haven't really answered my main question -- what are you 
trying to match?  are you trying to search for the literal term "*:*" in 
the description field? are you trying to do a wildcard search for terms 
that contain a colon in the middle (ie: "foo:bar"), are you trying to 
match all documents in the description field?

you've said it doesn't match anything, but you haven't explain what you 
expect it to match

(Actually .. lemme back up and ask a silly question -- are the "*" 
characters in your email actaully part of the query you are sending to 
solr, or is that just an artifact of your mail client translating bold or 
highlighted characters into "*" when converting to plain text?)

: what are you expecting that query to match?  because by backslash
: escpaing the colon, what you are asking for there is for Solr to search
: for the literal string "*:*" in your default search field (afterwhatever
: query time analysis is configured on your default search field)


-Hoss

RE: Term searches with colon(:)

Posted by "Nemani, Raj" <Ra...@turner.com>.
Hi Hoss,

Thank you for the reply and help.  The description field is part of the
defaultHandler's eDisMax search list (qf):

<requestHandler name="defaultHandler" class="solr.SearchHandler"
default="true">
                <lst name="defaults">
                                <str name="defType">edismax</str>
                                <str name="echoParams">explicit</str>
                                <float name="tie">0.01</float>
                                <str name="qf"> mpg description</str>
                
Similar queries for other escaped characters in "description" using term
search return correctly as shown from the logs correctly.

INFO: [] webapp=/XXXXXX path=/select
params={q=+(*\\\*)+&rows=1000&version=2.2} hits=2 status=0 QTime=16 
Sep 06, 2012 11:41:51 PM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/XXXXXX path=/select
params={q=+(*\%2B*)+&rows=1000&version=2.2} hits=2 status=0 QTime=0 
Sep 06, 2012 11:41:51 PM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/XXXXXX path=/select
params={q=+(*\-*)+&rows=1000&version=2.2} hits=2 status=0 QTime=0 
Sep 06, 2012 11:41:51 PM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/XXXXXX path=/select
params={q=+(*\%26*)+&rows=1000&version=2.2} hits=3 status=0 QTime=0 
Sep 06, 2012 11:41:51 PM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/XXXXXX path=/select
params={q=+(*\|*)+&rows=1000&version=2.2} hits=1 status=0 QTime=0 
Sep 06, 2012 11:41:51 PM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/XXXXXX path=/select
params={q=+(*\!*)+&rows=1000&version=2.2} hits=10 status=0 QTime=0 
Sep 06, 2012 11:41:51 PM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/XXXXXX path=/select
params={q=+(*\{*)+&rows=1000&version=2.2} hits=1 status=0 QTime=0 
Sep 06, 2012 11:41:51 PM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/XXXXXX path=/select
params={q=+(*\}*)+&rows=1000&version=2.2} hits=1 status=0 QTime=0 
Sep 06, 2012 11:41:51 PM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/XXXXXX path=/select
params={q=+(*\[*)+&rows=1000&version=2.2} hits=2 status=0 QTime=0 
Sep 06, 2012 11:41:51 PM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/XXXXXX path=/select
params={q=+(*\]*)+&rows=1000&version=2.2} hits=2 status=0 QTime=0 
Sep 06, 2012 11:41:51 PM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/XXXXXX path=/select
params={q=+(*\^*)+&rows=1000&version=2.2} hits=2 status=0 QTime=0 
Sep 06, 2012 11:41:51 PM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/XXXXXX path=/select
params={q=+(*\~*)+&rows=1000&version=2.2} hits=1 status=0 QTime=16

Thank you in advance for any clues you may have
Thanks
Raj


-----Original Message-----
From: Chris Hostetter [mailto:hossman_lucene@fucit.org] 
Sent: Friday, September 07, 2012 7:13 PM
To: solr-user@lucene.apache.org
Subject: Re: Term searches with colon(:)


: I was wondering if anybody has run into this issue before. Solr is not
: returing any search results for word that contain  colon ( : ) in it
: when we perform a term search containing colon.  We do escape this
: correctly, I believe as shown in the sample (taken from tomcat logs)
	...
: INFO: [] webapp=/XXXXX path=/select
: params={q=+(*\:*)+&rows=100&version=2.2} hits=0 status=0 QTime=0 

what are you expecting that query to match?  because by backslash
escpaing the colon, what you are asking for there is for Solr to search
for the literal string "*:*" in your default search field (afterwhatever
query time analysis is configured on your default search field)

: On the other hand if we prefix the term with a field name, we get
: correct results as shown below
	...
: INFO: [] webapp=/XXXXX path=/select
: params={q=(+description:*\:*)&rows=100&version=2.2} hits=1 status=0
: QTime=0 

perhaps the problem is that you are expecting "description" to be your
default search field but it is not configured that way?


-Hoss

Re: Term searches with colon(:)

Posted by Chris Hostetter <ho...@fucit.org>.
: I was wondering if anybody has run into this issue before. Solr is not
: returing any search results for word that contain  colon ( : ) in it
: when we perform a term search containing colon.  We do escape this
: correctly, I believe as shown in the sample (taken from tomcat logs)
	...
: INFO: [] webapp=/XXXXX path=/select
: params={q=+(*\:*)+&rows=100&version=2.2} hits=0 status=0 QTime=0 

what are you expecting that query to match?  because by backslash escpaing 
the colon, what you are asking for there is for Solr to search for the 
literal string "*:*" in your default search field (afterwhatever query 
time analysis is configured on your default search field)

: On the other hand if we prefix the term with a field name, we get
: correct results as shown below
	...
: INFO: [] webapp=/XXXXX path=/select
: params={q=(+description:*\:*)&rows=100&version=2.2} hits=1 status=0
: QTime=0 

perhaps the problem is that you are expecting "description" to be your 
default search field but it is not configured that way?


-Hoss