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 Olaia Vázquez Sánchez <ol...@udc.es> on 2004/04/27 19:40:03 UTC

Re-associate a token with its source

Hello

 

I have documents in XML in which, for each word, I have 4 positions (top,
down, left and right) that would let me to highlight this word in a jpg
image. I want to index this XML documents and to highlight the results of
the queries in the image, so I need to store this positions for each word
inside the index.

 

I was searching about how can I use the Token fields to store this
attributes but I didn’t found any example where this fields were used.

 

Thanks,

 

Olaia Vázquez


RE: Re-associate a token with its source

Posted by Olaia Vázquez Sánchez <ol...@udc.es>.
Thank you, but I think I didn't explained my problem clearly enough.

I have four positions (top, bottom, right and left) for each one of the
words of the document so I would have to store in the index the content of
the page with the positions in the middle.

org.apache.lucene.document.Field#UnIndexed("content", "house 1142 1231 3212
2214 dog 2213 2432 3214 2134 ...")

In order to get the values after a search I would need to parse the document
returned to find the positions that are next to the searched word. I have
seen that the class Token has 4 properties: beginColumn, beginLine,
endColumn and endLine and I don't know if it is possible to use them to
store for each token the position that I want.

I think this approach is not the correct one so any help on this would be
appreciated.


Olaia.

-----Mensaje original-----
De: Stephane James Vaucher [mailto:vauchers@cirano.qc.ca] 
Enviado el: martes, 27 de abril de 2004 21:46
Para: Lucene Users List
Asunto: Re: Re-associate a token with its source

When indexing, use UnIndexed fields to store this data in your document.

org.apache.lucene.document.Field#UnIndexed(String name, String value) 

Add the fields using:
org.apache.lucene.document.Document.add(Field)

After your search, you can get the field value from:
Document Hits.doc(int)

You can retrieve your store values using 
String Document.get(String name) 

HTH,
sv

On Tue, 27 Apr 2004, Olaia Vázquez Sánchez wrote:

> Hello
> 
>  
> 
> I have documents in XML in which, for each word, I have 4 positions (top,
> down, left and right) that would let me to highlight this word in a jpg
> image. I want to index this XML documents and to highlight the results of
> the queries in the image, so I need to store this positions for each word
> inside the index.
> 
>  
> 
> I was searching about how can I use the Token fields to store this
> attributes but I didn’t found any example where this fields were used.
> 
>  
> 
> Thanks,
> 
>  
> 
> Olaia Vázquez
> 
> 


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


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


Re: Re-associate a token with its source

Posted by Stephane James Vaucher <va...@cirano.qc.ca>.
When indexing, use UnIndexed fields to store this data in your document.

org.apache.lucene.document.Field#UnIndexed(String name, String value) 

Add the fields using:
org.apache.lucene.document.Document.add(Field)

After your search, you can get the field value from:
Document Hits.doc(int)

You can retrieve your store values using 
String Document.get(String name) 

HTH,
sv

On Tue, 27 Apr 2004, Olaia Vázquez Sánchez wrote:

> Hello
> 
>  
> 
> I have documents in XML in which, for each word, I have 4 positions (top,
> down, left and right) that would let me to highlight this word in a jpg
> image. I want to index this XML documents and to highlight the results of
> the queries in the image, so I need to store this positions for each word
> inside the index.
> 
>  
> 
> I was searching about how can I use the Token fields to store this
> attributes but I didn’t found any example where this fields were used.
> 
>  
> 
> Thanks,
> 
>  
> 
> Olaia Vázquez
> 
> 


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