The issue is that the real world document has more than 2 fields. Me giving
an example of two was a bit misleading. I can't really "pair" them. Here's a
better example:
Resume_a
Exp_1
Language:Java, Years:5, Certification:Sun, Area:Web
Exp_2
Language:C, Years:3, Certification:None, Are
Well, a variant on the easy solution might. What would
happen if you indexed the un-split pairs in the same
field? I.e.
"java:5", "c:3", "php:2" all indexed as *single* tokens
in the *same* field?
But I think you should look at Digy's suggestion again.
6-10 fields is absolutely no problem at all.
Found public int getPositionIncrementGap(String fieldName) on Analyzer.
Sweet! Should've read more before emailing.
tjk :)
On Fri, Jan 15, 2010 at 10:19 AM, TJ Kolev wrote:
> Hi!
>
> I don't think the easy solution will work for me, because I'll have more
> than two fields in a group - perhaps
Hi!
I don't think the easy solution will work for me, because I'll have more
than two fields in a group - perhaps 6 - 10.
However using span queries looks very promising. I'll investigate that.
I see setPositionIncrement() only on the Token object. Is there a way to set
this when adding a field
Ooooh, isn't that easier. You just prompted me to think
that you don't even have to do that, just index the pairs as single
tokens (KeywordAnalyzer? but watch out for no case folding)...
On Wed, Jan 13, 2010 at 4:30 PM, Digy wrote:
> How about using languages as fieldnames?
> Doc1(Ra):
>
How about using languages as fieldnames?
Doc1(Ra):
Java:5
C:2
PHP:3
Doc2(Rb)
Java:2
C:5
VB:1
Query:Java:5 AND C:2
DIGY
-Original Message-
From: TJ Kolev [mailto:tjko...@gmail.com]
Sent: Wednesday, January 13, 2010 11:00 PM
To: jav
One approach would be to do this with multi-valued fields. The
idea here is to index all your E fields in the *same* Lucene
field with an increment gap (see getPositionIncrementGap) > 1.
For this example, assume getPositionIncrementGap returns 100.
Then, for your documents you have something like