RE: [sort order]how to support sort by max(field1),then field2 desc.

2013-05-07 Thread Jack Liu
Hi, Ian That sounds a good idea. Thank you very much for your help. Thanks -Original Message- From: Ian Lea [mailto:ian@gmail.com] Sent: 2013年5月7日 19:09 To: java-user@lucene.apache.org Subject: Re: [sort order]how to support sort by max(field1),then field2 desc. I think you'll hav

Re: TrackingIndexWriter.tryDeleteDocument(IndexReader, int) vs deleteDocuments(Query)

2013-05-07 Thread Reg
There you go. By the way, love your blogs. On Tue, May 7, 2013 at 4:59 PM, Michael McCandless < luc...@mikemccandless.com> wrote: > I'm afraid the mailing list stripped the attachment ... could you post > it inline? Or, CC me directly with the attachment? > > Thanks. > > Mike McCandless > > h

Re: TrackingIndexWriter.tryDeleteDocument(IndexReader, int) vs deleteDocuments(Query)

2013-05-07 Thread Michael McCandless
I'm afraid the mailing list stripped the attachment ... could you post it inline? Or, CC me directly with the attachment? Thanks. Mike McCandless http://blog.mikemccandless.com On Tue, May 7, 2013 at 7:18 PM, Reg wrote: > Hi Mike, > > Here's the unit test I put together. I assume you have J

Re: Subclassing QueryScorer

2013-05-07 Thread Michael Sokolov
On 5/7/2013 6:26 PM, Colin Pollock wrote: Hi, I want to modify how the QueryScorer selects fragments for snippeting. I want to add a small boost for fragments that contain certain terms (e.g. "great", "amazing") to the unique term occurrence score. But I don't want these words to actually be high

Re: TrackingIndexWriter.tryDeleteDocument(IndexReader, int) vs deleteDocuments(Query)

2013-05-07 Thread Reg
Hi Mike, Here's the unit test I put together. I assume you have JUnit. On Tue, May 7, 2013 at 12:18 PM, Michael McCandless < luc...@mikemccandless.com> wrote: > On Tue, May 7, 2013 at 1:58 PM, Reg wrote: > > TrackingIndexWriter.tryDeleteDocument(IndexReader, int) returns an > > AtomicInteger

Subclassing QueryScorer

2013-05-07 Thread Colin Pollock
Hi, I want to modify how the QueryScorer selects fragments for snippeting. I want to add a small boost for fragments that contain certain terms (e.g. "great", "amazing") to the unique term occurrence score. But I don't want these words to actually be highlighted, so I can't just add them to the que

Re: TrackingIndexWriter.tryDeleteDocument(IndexReader, int) vs deleteDocuments(Query)

2013-05-07 Thread Michael McCandless
On Tue, May 7, 2013 at 1:58 PM, Reg wrote: > TrackingIndexWriter.tryDeleteDocument(IndexReader, int) returns an > AtomicInteger indexingGen. And in my case it returns 1 which means the > underlying IndexWriter.tryDeleteDocument(IndexReader, int) returns true. If tryDeleteDocument returned 1 then

Re: TrackingIndexWriter.tryDeleteDocument(IndexReader, int) vs deleteDocuments(Query)

2013-05-07 Thread Reg
TrackingIndexWriter.tryDeleteDocument(IndexReader, int) returns an AtomicInteger indexingGen. And in my case it returns 1 which means the underlying IndexWriter.tryDeleteDocument(IndexReader, int) returns true. TrackingIndexWriter is not IndexWriter and we can't pass it to DirectoryReader.open(..

RE: [PhraseQuery] Can "jakarta apache"~10 be searched by offset ?

2013-05-07 Thread wgggfiy
ok,thx but now How can I implemt this requirement ?Jack gave me a clue, but I failed, and it returns no docs when I cameup with a regex query like "jakarta.{1,10}apache"Is there some limitations when use regex query like not indexed and son on ? - -- Email: wuqiu.m...

Re: [sort order]how to support sort by max(field1),then field2 desc.

2013-05-07 Thread Ian Lea
I think you'll have to run 2 searches with 2 sorts - the first to get max(field1) and the second sorted by field2. If you don't want the max(field1) doc to appear in the second list you'll have to filter it out somehow. -- Ian. On Tue, May 7, 2013 at 6:49 AM, Jack Liu wrote: > As we know, the

Re: TrackingIndexWriter.tryDeleteDocument(IndexReader, int) vs deleteDocuments(Query)

2013-05-07 Thread Ian Lea
Does the tryDeleteDocument() call return true or false? The 4.2.1 javadocs for IndexWriter.tryDeleteDocument says "If the provided reader is an NRT reader obtained from this writer ... then the delete succeeds and this method returns true; else, it returns false" Maybe you need mgrWriter.tryDelet

Re: lucene running problem

2013-05-07 Thread Gaurav Ranjan
Hi, Yes it is actually the directory that you want to be indexed. I suppose it is the demo HelloLucene.java code that you are trying to run. Regards, Gaurav Ranjan. On Tue, May 7, 2013 at 12:41 AM, sindhu hosamane wrote: > Hello , > > I downloaded and extracted lucene 4.2.1 , and set the 4 j

Re: TermRangeQuery performance oddness

2013-05-07 Thread Aleksey
Thank you for the detailed answer. I'll look into the FieldCacheRangeFilter. Is there another way of getting a page of results starting with some term that does not have similar issue? Basically I want to implement pagination of docs sorted by title, next page starting from last doc of the previous

RE: [PhraseQuery] Can "jakarta apache"~10 be searched by offset ?

2013-05-07 Thread Uwe Schindler
There is no query in Lucene that can do this at the moment. It may be possible to implement this in later versions of Lucene (4.x, if you have offsets indexed into your posting list, which can be enabled in recent Lucene), but that’s not yet implemented. The problem here is also that every term

RE: TermRangeQuery performance oddness

2013-05-07 Thread Uwe Schindler
Hi, The problem is by design: Lucene is an inverted index, so lookups can only be done by single terms and find the documents related to every single term. To execute a range, the query first have to position the terms enum on the first term and then iterate over all *terms* in the index (not d