I would be pretty skeptical of this approach You're mixing numeric data with textual data and I expect the results to be unpredictable. You already said "it is working for most of the documents except one or two documents." I predict you'll find more and more of these as time passes.
Expect many more anomalies. At best you need to index both forms as text rather than mixing numeric and text data. Since you're not sorting you should be OK with the caveat that searching for "02" won't match an indexed value of "2" unless you remove all leading zeros at both index and query time. Best, Erick On Tue, Oct 27, 2015 at 11:31 AM, Kumaran Ramasubramanian <kums....@gmail.com> wrote: > Yes Will, You are right. But i dont use "status" field for sorting. i have > other fields that is being used for sorting specifically. And so i dont > face any issues in sorting as of now. > > -- > Kumaran R > > > On Tue, Oct 27, 2015 at 7:20 PM, will <wmartin...@gmail.com> wrote: > >> Kumaran - >> >> Aren't you creating an unworkable scenario for sorting? >> >> -will >> >> On 10/27/15 5:49 AM, Kumaran Ramasubramanian wrote: >> >>> Hi All, >>> >>> i have indexed module wise data in same index. In this case, we index >>> two >>> types of field in same name in two different document like this. >>> >>> *document1:* >>> >>> module:1 >>>> status:4 ( as LongField ) >>>> >>>> *code:* >>> >>> long longValue=Long.parseLong(value); >>>> LongField field=new LongField(f >>>> ield >>>> Name,longValue, Field.Store.YES); >>>> document.add(field); >>>> >>>> >>> *document2:* >>> >>> module:2 >>>> status:open ( as Field ) >>>> >>> *code:* >>> >>> >>>> Field field = new Field( >>>> f >>>> >>>> ield >>>> Name, value, (Field.Store) stored, (Field.Index) indexType); >>>> >>> document.add(field); >>> >>> >>> >>>> >>>> There are around 50lakh documents in my index which has these kind of >>> mixed >>> type of fields >>> >>> when i query like status:4 or status:open, it is working for most of the >>> documents except one or two documents. >>> >>> Not able to reproduce the same in other indexes. So i want confirm whether >>> it is supported to have both Field & LongField with same field name in >>> same >>> index. And also Please suggest me any articles discussing this kind of >>> problem. >>> >>> Thanks :-) >>> >>> Related links: >>> http://www.gossamer-threads.com/lists/lucene/java-user/109530 >>> >>> -- >>> ** >>> Kumaran R >>> >>> >> --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org