Re: Problem querying Lucene after escaping

2012-06-26 Thread secevalliv
Thanks for the advice Ian. As you suggested I tried indexing alt_id as Index.NOT_ANALYZED and stick with TermQuery. It works now. Thanks again, José M. Villaveces On 25 June 2012 17:27, Ian Lea wrote: > The key thing is to be consistent. You can either replace your > TermQuery code with the

Re: Problem querying Lucene after escaping

2012-06-25 Thread Ian Lea
The key thing is to be consistent. You can either replace your TermQuery code with the output from QueryParser.parse, with QP created with StandardAnalyzer, or index alt_id as Index.NOT_ANALYZED and stick with TermQuery. I think the latter will work even with multiple terms/tokens stored for alt_

Re: Problem querying Lucene after escaping

2012-06-25 Thread secevalliv
Hi All, Thanks for the quick reply. It seems like indeed my index is not what I think it is so maybe I'm using the wrong analyzer. Here is the code I use to index the multiple values of alt_id: indexWriter = new IndexWriter(FSDirectory.open(new File(path)),newStandardAnalyzer(Version. LUCENE_30)

Re: Problem querying Lucene after escaping

2012-06-25 Thread Erick Erickson
TermQuerys are assumed to be parsed already. So you're looking for a _single_ term "ncbi-geneid:379474 or XI.24622". You'd construct something like Query query1 = new TermQuery(new Term("type", "gene")); Query query2 = new TermQuery(new Term("alt_Id", "ncbi-geneid:379474")); Query query3 = new Te

Re: Problem querying Lucene after escaping

2012-06-25 Thread Ian Lea
It's probably an issue with analysis and colons and hyphens and dots, maybe lower/upper case as well. Are you using an analyzer? Which? If not, which might be consistent with your usage of TermQuery, how are you storing the multiple values for alt_id? See also the FAQ entry "Why am I getting no

Problem querying Lucene after escaping

2012-06-25 Thread secevalliv
I'm quite new to Lucene and recently, I ran into a problem. I have a lucene document that looks like this: --- type --- gene --- id --- xla:379474 --- alt_id --- emb:BC054227 gb:BC054227 ncbi-geneid:379474 ncbi-gi:148230166 rs:NM_001086315 rs:NP_001079784 unigene:Xl.24622 xla:379474 I created