Re: Starts with Query
Thanks Jack for valuable response,Actually i am trying to match *any* numeric pattern at the start of each document. I dont know documents in index i just want documents title starting with any digit. -- View this message in context: http://lucene.472066.n3.nabble.com/Starts-with-Query-tp3989627p3989761.html Sent from the Solr - User mailing list archive at Nabble.com.
RE: Starts with Query
If you are not searching for the specific digit and want to match all documents that start with any digit, you could as part of the indexing process, have another field say startsWithDigit and set it to true if it the title begins with a digit. All you need to do at query time then is query for startsWithDigit =true. Thanks Afroz From: nutchsolruser Sent: 6/14/2012 11:03 PM To: solr-user@lucene.apache.org Subject: Re: Starts with Query Thanks Jack for valuable response,Actually i am trying to match *any* numeric pattern at the start of each document. I dont know documents in index i just want documents title starting with any digit. -- View this message in context: http://lucene.472066.n3.nabble.com/Starts-with-Query-tp3989627p3989761.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Starts with Query
It's not necessary to do this. You can simply be happy about the fact that all digits are ordered strictly in unicode, so you can use a range query: (f)q={!frange l=0 u=\: incl=true incu=false}title This finds all documents where any token from the title field starts with a digit, so if you want to only find documents where the whole title starts with a digit, you need a second field with a string or untokenized text type. Use the copyField directive then, as Jack Krupansky already suggested in a previous reply. Greetings, Kuli Am 15.06.2012 08:38, schrieb Afroz Ahmad: If you are not searching for the specific digit and want to match all documents that start with any digit, you could as part of the indexing process, have another field say startsWithDigit and set it to true if it the title begins with a digit. All you need to do at query time then is query for startsWithDigit =true. Thanks Afroz From: nutchsolruser Sent: 6/14/2012 11:03 PM To: solr-user@lucene.apache.org Subject: Re: Starts with Query Thanks Jack for valuable response,Actually i am trying to match *any* numeric pattern at the start of each document. I dont know documents in index i just want documents title starting with any digit. -- View this message in context: http://lucene.472066.n3.nabble.com/Starts-with-Query-tp3989627p3989761.html Sent from the Solr - User mailing list archive at Nabble.com.
Starts with Query
I want to find documents whose title is starting with digit, what will be solr query for this. I have tried many queries but could not able to configure proper query for this. Note : title is a field in my index. -- View this message in context: http://lucene.472066.n3.nabble.com/Starts-with-Query-tp3989627.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Starts with Query
I want to find documents whose title is starting with digit, what will be solr query for this. I have tried many queries but could not able to configure proper query for this. Note : title is a field in my index. Something like this? q=title:(1* 2* 3* 4* ... 9*)q.op=OR
Re: Starts with Query
Are you trying to query for any numeric term at the start of a title or a specific numeric term at the start of a title? Unless you are using a query parser that supports Lucene's SpanFirstQuery or SpanPositionRangeQuery, you have two choices: 1. Explicitly (or implicitly via a custom update processor) add a marker term so you can match beginning of title if you are looking for a specific numeric term, such as markertext 123. 2. Add a second title field that is a string field type, say title_s, with a copyField from title to title_s, and then do a regex query to check for a digit at the beginning of the string form of the title, or use a trailing wildcard if you know the exact leading numeric value, such as 123 *. -- Jack Krupansky -Original Message- From: nutchsolruser Sent: Thursday, June 14, 2012 8:42 AM To: solr-user@lucene.apache.org Subject: Starts with Query I want to find documents whose title is starting with digit, what will be solr query for this. I have tried many queries but could not able to configure proper query for this. Note : title is a field in my index. -- View this message in context: http://lucene.472066.n3.nabble.com/Starts-with-Query-tp3989627.html Sent from the Solr - User mailing list archive at Nabble.com.