lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ManjuNS <manjunath...@gmail.com>
Subject Help regarding choosing Indexing Stratergies
Date Tue, 06 Oct 2009 14:54:54 GMT

In my Application currently I am indexing Object with One Field[ID] to Hold
ID of the Object which is stored and attributes of Object into Another Field
[Content] to hold attribute information seperated by space and this Field is
tokenized. When I search for information related to the Object I get result
as ID and using that ID I fetech the information from backend and I show it
as search result.

Now the requirement is for some user of the application who don't have
access to attributes in Object and search on that attribute information,
then Object should not be included in the result.

The reason why I see is not possible is as I am not Storing each attribute
as Field instead Instead I am indexing many small text fields, aggregate the
text into a single "contents" field and index only that.

So is there any better approach for Indexing? Please help me out.

Code Snippet:

Document doc = new Document(..);
Field objField = new Field("ID", objId, Field..STORE.YES)
String attrValue = "";
for(Attribute att: allAttributes){
    attrValue += att.getValue() + " ";
}
Field attField = new Field("content", attrValue, Field.STORE.NO,
Field.Index.TOKENIZED)

Attributes are shown to user based on their access. 
-- 
View this message in context: http://www.nabble.com/Help-regarding-choosing-Indexing-Stratergies-tp25770324p25770324.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


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


Mime
View raw message