Re: SpanQuery for Terms at same position

2009-11-30 Thread Christopher Tignor
It would take a bit of work work / learning (haven't used a RAMDirectory yet) to make them into test cases usable by others and am deep into this project and under the gun right now. But if some time surfaces I will for sure... thanks - C>T> On Wed, Nov 25, 2009 at 7:49 PM, Erick Erickson wrote

Re: SpanQuery for Terms at same position

2009-11-25 Thread Erick Erickson
Hmmm, are they unit tests? Or would you be wiling to create stand-alone unit tests demonstrating this and submit it as a patch? Best er...@alwaystrollingforworkfromothers.opportunistic. On Wed, Nov 25, 2009 at 5:38 PM, Christopher Tignor wrote: > my own tests with my own data show you are correc

Re: SpanQuery for Terms at same position

2009-11-25 Thread Christopher Tignor
my own tests with my own data show you are correct and the 1-n slop works for matching terms at the same ordinal position. thanks! C>T> On Wed, Nov 25, 2009 at 4:25 PM, Paul Elschot wrote: > Op woensdag 25 november 2009 21:20:33 schreef Christopher Tignor: > > It's worth noting however that thi

Re: SpanQuery for Terms at same position

2009-11-25 Thread Paul Elschot
Op woensdag 25 november 2009 21:20:33 schreef Christopher Tignor: > It's worth noting however that this -1 slop doesn't seem to work for cases > where oyu want to discover instances of more than two terms at the same > position. Would be nice to be able to explicitly set this in the query > constr

Re: SpanQuery for Terms at same position

2009-11-25 Thread Christopher Tignor
It's worth noting however that this -1 slop doesn't seem to work for cases where oyu want to discover instances of more than two terms at the same position. Would be nice to be able to explicitly set this in the query construction. thanks, C>T> On Tue, Nov 24, 2009 at 9:17 AM, Christopher Tignor

Re: SpanQuery for Terms at same position

2009-11-24 Thread Christopher Tignor
yes that indeed works for me. thanks, C>T> On Mon, Nov 23, 2009 at 5:50 PM, Paul Elschot wrote: > Op maandag 23 november 2009 20:07:58 schreef Christopher Tignor: > > Also, I noticed that with the above edit to NearSpansOrdered I am getting > > erroneous results fo normal ordered searches using

Re: SpanQuery for Terms at same position

2009-11-23 Thread Paul Elschot
Op maandag 23 november 2009 20:07:58 schreef Christopher Tignor: > Also, I noticed that with the above edit to NearSpansOrdered I am getting > erroneous results fo normal ordered searches using searches like: > > "_n" followed by "work" > > where because "_n" and "work" are at the same position t

Re: SpanQuery for Terms at same position

2009-11-23 Thread Christopher Tignor
Also, I noticed that with the above edit to NearSpansOrdered I am getting erroneous results fo normal ordered searches using searches like: "_n" followed by "work" where because "_n" and "work" are at the same position the code changes accept their pairing as a valid in-order result now that the

Re: SpanQuery for Terms at same position

2009-11-23 Thread Christopher Tignor
Thanks so much for this. Using an un-ordered query, the -1 slop indeed returns the correct results, matching tokens at the same position. I tried the same query but ordered both after and before rebuilding the source with Paul's changes to NearSpansOrdered but the query was still failing, returni

Re: SpanQuery for Terms at same position

2009-11-23 Thread Mark Miller
Your trying -1 with ordered right? Try it with non ordered. Christopher Tignor wrote: > A slop of -1 doesn't work either. I get no results returned. > > this would be a *really* helpful feature for me if someone might suggest an > implementation as I would really like to be able to do arbitrary s

Re: SpanQuery for Terms at same position

2009-11-23 Thread Paul Elschot
Op maandag 23 november 2009 17:27:56 schreef Christopher Tignor: > A slop of -1 doesn't work either. I get no results returned. I think the problem is in the NearSpansOrdered.docSpansOrdered methods. Could you replace the < by <= in there (4 times) and try again? That will allow spans at the same

Re: SpanQuery for Terms at same position

2009-11-23 Thread Christopher Tignor
A slop of -1 doesn't work either. I get no results returned. this would be a *really* helpful feature for me if someone might suggest an implementation as I would really like to be able to do arbitrary span searches where tokens may be at the same position and also in other positions where the or

Re: SpanQuery for Terms at same position

2009-11-23 Thread Christopher Tignor
Tested it out. It doesn't work. A slop of zero indicates no words between the provided terms. E.g. my query of "plan" "_n" returns entries like "contingency "plan". My work around for this problem is to use a PhraseQuery, where you can explicitly set Terms to occur at the same location, t oreco

Re: SpanQuery for Terms at same position

2009-11-22 Thread Adriano Crestani
You are right Paul, 0 would not work, probably something less than zero, as Paul suggested. Give it a try and tell us if it worked ; ) On Sun, Nov 22, 2009 at 9:50 AM, Paul Elschot wrote: > Op zondag 22 november 2009 04:47:50 schreef Adriano Crestani: > > Hi, > > > > I didn't test, but you might

Re: SpanQuery for Terms at same position

2009-11-22 Thread Paul Elschot
Op zondag 22 november 2009 04:47:50 schreef Adriano Crestani: > Hi, > > I didn't test, but you might want to try SpanNearQuery and set slop to zero. > Give it a try and let me know if it worked. The slop is the number of positions "in between", so zero would still be too much to only match at the

Re: SpanQuery for Terms at same position

2009-11-21 Thread Adriano Crestani
Hi, I didn't test, but you might want to try SpanNearQuery and set slop to zero. Give it a try and let me know if it worked. Regards, Adriano Crestani On Thu, Nov 19, 2009 at 7:28 PM, Christopher Tignor wrote: > Hello, > > I would like to search for all documents that contain both "plan" and "_

SpanQuery for Terms at same position

2009-11-19 Thread Christopher Tignor
Hello, I would like to search for all documents that contain both "plan" and "_v" (my part of speech token for verb) at the same position. I have tokenized the documents accordingly so these tokens exists at the same location. I can achieve programaticaly using PhraseQueries by adding the Terms e