lucene - Which field type should I use to store true/false values? -
i want store boolean value, not sure field type use.
so theoretically:
doc.add(new ????("numeric", true) doc.add(new ????("alphatic", true) doc.add(new ????("alphanumeric", true)
i querying using these boolean field types like:
- search numeric only
- search alphabetic only
- search alphanumeric
any comments on best approach? (speed/effeciency important ofcourse)
i think, stringfield job since don't want values - true or false tokenized. also, third parameter in constructor , can choose store field or part of index without getting stored.
javadoc ,
a field indexed not tokenized: entire string value indexed single token. example might used 'country' field or 'id' field, or field intend use sorting or access through field cache.
new stringfield("numeric", "true", store.no)....etc.
Comments
Post a Comment