Exact Field Match
Hi, Does Lucene have support for exact field match? Is there a way to say that this field equals exactly this value? I know I can do it by using an untokenized field. But I have some values that I would want to store in both tokenized and untokenized copies of the same field. Instead of doing that I'm just storing the tokenized version. For example: MyField = "My value." I want to search where "My value." is the exact match for this field but I also sometime want to do a containing search so that just a query for "value" matches. I'm planning on extracting the stored value and comparing it to see if its an exact match. If you have a better idea please send it my way! Thanks, Reece - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Number query not working
Thanks Erik! That showed me the problem right away. -Reece --- Lucene Users List" <[EMAIL PROTECTED] wrote: On May 26, 2004, at 6:38 PM, [EMAIL PROTECTED] wrote: > > It looks like its because I'm using the SimpleAnalyzer instead of the > > StandardAnalyzer. What is the SimpleAnalyzer to this query to make it > > not > > work? > > http://wiki.apache.org/jakarta-lucene/AnalysisParalysis > > It is a good idea to analyze the analyzer. Do a .toString output of > the Query and you'll see clearly what happened. > > Erik > > > > > > > Thanks, > > Reece > > > > --- Lucene Users List" <[EMAIL PROTECTED] > > wrote: > > Hi, > >> > >> I have a bunch of digits in a field. When I do this search > > it returns > >> nothing: > >> > >> myField:001085609805100 > >> > >> It returns > > the correct document > >> when I add a * to the end like this: > >> > >> myField:001085609805100* > > <-- > >> added the * > >> > >> I'm not sure what is happening here. I'm thinking > > that Lucene > >> is doing some number conversion internally when it sees only > > digits. When > >> I add the * maybe it presumes it is still a string. > >> > > > >> How do I get a string > >> of digits to work without adding a *? > >> > >> > > Thanks, > >> Reece > >> > >> - > > > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For > > additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Number query not working
Whoa! I reread my last post and the last sentence didn't make much sense. This is what I meant to say: "What is the SimpleAnalyzer doing to this query to make it not work?" --- Lucene Users List" <[EMAIL PROTECTED] wrote: Hi, > > It looks like its because I'm using the SimpleAnalyzer instead of the > StandardAnalyzer. What is the SimpleAnalyzer to this query to make it not > work? > > Thanks, > Reece > > --- Lucene Users List" <[EMAIL PROTECTED] > wrote: > Hi, > > > > I have a bunch of digits in a field. When I do this search > it returns > > nothing: > > > > myField:001085609805100 > > > > It returns > the correct document > > when I add a * to the end like this: > > > > myField:001085609805100* > <-- > > added the * > > > > I'm not sure what is happening here. I'm thinking > that Lucene > > is doing some number conversion internally when it sees only > digits. When > > I add the * maybe it presumes it is still a string. > > > > > How do I get a string > > of digits to work without adding a *? > > > > > Thanks, > > Reece > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For > additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Number query not working
Hi, It looks like its because I'm using the SimpleAnalyzer instead of the StandardAnalyzer. What is the SimpleAnalyzer to this query to make it not work? Thanks, Reece --- Lucene Users List" <[EMAIL PROTECTED] wrote: Hi, > > I have a bunch of digits in a field. When I do this search it returns > nothing: > > myField:001085609805100 > > It returns the correct document > when I add a * to the end like this: > > myField:001085609805100* <-- > added the * > > I'm not sure what is happening here. I'm thinking that Lucene > is doing some number conversion internally when it sees only digits. When > I add the * maybe it presumes it is still a string. > > How do I get a string > of digits to work without adding a *? > > Thanks, > Reece > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Number query not working
Hi, I have a bunch of digits in a field. When I do this search it returns nothing: myField:001085609805100 It returns the correct document when I add a * to the end like this: myField:001085609805100* <-- added the * I'm not sure what is happening here. I'm thinking that Lucene is doing some number conversion internally when it sees only digits. When I add the * maybe it presumes it is still a string. How do I get a string of digits to work without adding a *? Thanks, Reece - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Range searches for numbers
Thanks for the info. The Date formatter doesn't work because it can only deal with positive longs. My problem was how to handle the negatives but I got it figured out. Thanks! --- Lucene Users List" <[EMAIL PROTECTED] wrote: Quick reference: > > http://wiki.apache.org/jakarta-lucene/SearchNumericalFields > > If you are stuck, you can always encode the long in a string format (the > date formatter in lucene might do this already). Or even, you could also > treat it like a date and use your long like a date filter. > > HTH, > sv > > On 6 May 2004 [EMAIL PROTECTED] wrote: > > > Hi, > > > > What's the best way to store numbers for range searching? If someone > > has some info about this I'd love to see it. > > > > This is my current plan: > > When I convert the number to a string I will zero pad it so range searches > > work. The conversions will be like this for integers: > >1 to 101 > > > >2 to 102 > > 1000 to 1001000 > > > > I'm just adding a "1" to the > > start of the string (or adding 10). This is so negative numbers work > > too! They will just be subtracted from a long (10): > >-1 to 099 > > > >-2 to 098 > > -1000 to 0999000 > > > > This works great for range > > searches. But how do I convert negative longs? I can't subtract 100 > > from a long can I? It too big to fit in another long. > > > > Any advice is appreciated! > > > > -Reece > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Range searches for numbers
Hi, What's the best way to store numbers for range searching? If someone has some info about this I'd love to see it. This is my current plan: When I convert the number to a string I will zero pad it so range searches work. The conversions will be like this for integers: 1 to 101 2 to 102 1000 to 1001000 I'm just adding a "1" to the start of the string (or adding 10). This is so negative numbers work too! They will just be subtracted from a long (10): -1 to 099 -2 to 098 -1000 to 0999000 This works great for range searches. But how do I convert negative longs? I can't subtract 100 from a long can I? It too big to fit in another long. Any advice is appreciated! -Reece - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]