Re: TermRangeQuery with multiple words

2012-08-20 Thread Jochen Hebbrecht
Hi Jack, Thanks, your solution could work too, but I prefer Ian his solution. I only have to index the data once, and the solution takes place in an easy place in the business logic. But perhaps, somebody else with this problem could use your solution. Happy that you've posted this solution as wel

Re: TermRangeQuery with multiple words

2012-08-20 Thread Jack Krupansky
You could index the values in both a "text" and a separate "string" field. Then you can query the text field by keyword as well as the string field by the full literal value, or as a wildcard or prefix query (e.g., "Microsoft*"), or as a range query with the full literal string values. -- Jack

Re: query

2012-08-20 Thread Ian Lea
No. See the FAQ. http://wiki.apache.org/lucene-java/LuceneFAQ#How_do_I_update_a_document_or_a_set_of_documents_that_are_already_indexed.3F There are a couple of ideas floating around e.g. http://www.flax.co.uk/blog/2012/06/22/updating-individual-fields-in-lucene-with-a-redis-backed-codec/ or http

Re: query

2012-08-20 Thread grainne wallace
Hi there, Is it possible to update a document in the lucene index with an additional field? I have a massive index and would like to add a numeric field with a date in number format into each document. This is to perform searches with NumericRangeFilters using the dates as numbers when search

Re: TermRangeQuery with multiple words

2012-08-20 Thread Jochen Hebbrecht
Hehe Ian, our mails just crossed. I was thinking in the same way! :-). Thanks for your reply! 2012/8/20 Ian Lea > Jochen > > > No, I don't think that Lucene can make a String range query on > multiple terms. For your Microsoft example you could build a query > with Microsoft as required TermQue

Re: TermRangeQuery with multiple words

2012-08-20 Thread Jochen Hebbrecht
Hmm, just thinking. I could split the value on spaces. Then I can say: +TEST:Microsoft +TEST:[Belgium TO Spain] I just tested it, and it seems to work :-) ... 2012/8/20 Jochen Hebbrecht > Hi Ian, > > Thanks for your answer! > Well, my example might have been not so clear. Here's a better exam

Re: TermRangeQuery with multiple words

2012-08-20 Thread Ian Lea
Jochen No, I don't think that Lucene can make a String range query on multiple terms. For your Microsoft example you could build a query with Microsoft as required TermQuery and a required TermRangeQuery from Belgium to Spain but that would fall apart with multiword company or region names. It

Re: TermRangeQuery with multiple words

2012-08-20 Thread Jochen Hebbrecht
Hi Ian, Thanks for your answer! Well, my example might have been not so clear. Here's a better example: Doc 01: TEST: "Microsoft Belgium" Doc 02: TEST: "Apple" Doc 03: TEST: "Microsoft France" Doc 04: TEST: "Evian" Doc 05: TEST: "Nokia" Doc 06: TEST: "Novotel" Doc 07: TEST: "Microsoft Germany" Do

Re: TermRangeQuery with multiple words

2012-08-20 Thread Ian Lea
This won't work with TermRangeQuery because neither "test 1" not "test 3" are terms. "test" will be a term, output by the analyzer. You'll be able to see the indexed terms in Luke. Sounds very flaky anyway - you'd get "term 10 xxx" and "term 100 xxx" as well as "term 1" and "term 2". If your TE

Re: query

2012-08-20 Thread Ian Lea
org.apache.lucene.index.PKIndexSplitter in contrib-misc sounds promising. www.slideshare.net/abial/eurocon2010 "Munching & crunching - Lucene index post-processing" sounds well worth a look too. Or just build new indexes from scratch routing docs to the correct index however you choose. -- Ian

query

2012-08-20 Thread grainne wallace
Hi there, I currently have a lucene index based on version 3.5 made up of xml documents. I'd like to create smaller indexes from the main index ; 1) an index based on a date range from the last week 2) an index based on the last month 3) an index based on the last 3 months. The reason I would

Re: Find documents contained in search term

2012-08-20 Thread Aditya
Hi You need to use prefix query for your requirement. Below are my thoughts and hope it helps. Say "Hello World" is your phrase. 1. Do a phrase query with your phrase ("Hello World") 2. If not found then strip the last character and then do prefix query ("Hello Worl") 3. Continue step 2 still yo