You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Igor Shalyminov <is...@yandex-team.ru> on 2013/01/21 09:04:46 UTC

Indexing multiple fields with one document position

Hello!

When indexing text with position data, one just adds field do a document in the form of its name and value, and the indexer assigns it unique position in the index.
I wonder, if I have an entry with two attributes, say:

<entry pos = "Noun" number = "singular">cat</entry>,

How do I store in the index two fields, "pos" and "number" with its values, pointing to the same position in the document?

-- 
Best Regards,
Igor Shalyminov

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Indexing multiple fields with one document position

Posted by Jack Krupansky <ja...@basetechnology.com>.
Send the same input text to two different analyzers for two separate fields. 
The first analyzer emits only the first attribute. The second analyzer emits 
only the second attribute. The document position in one will correspond to 
the document position in the other.

-- Jack Krupansky

-----Original Message----- 
From: Igor Shalyminov
Sent: Monday, January 21, 2013 3:04 AM
To: java-user@lucene.apache.org
Subject: Indexing multiple fields with one document position

Hello!

When indexing text with position data, one just adds field do a document in 
the form of its name and value, and the indexer assigns it unique position 
in the index.
I wonder, if I have an entry with two attributes, say:

<entry pos = "Noun" number = "singular">cat</entry>,

How do I store in the index two fields, "pos" and "number" with its values, 
pointing to the same position in the document?

-- 
Best Regards,
Igor Shalyminov

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org 


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org