Could you give us a self-contained test case that reproduces this issue?
Erik
On Apr 12, 2005, at 9:19 AM, Bill Tschumy wrote:
This problem is seeming more and more strange. It now looks like if
the fieldName I'm sorting on starts is ASCII "j" or above, the
RuntimeException is thrown. Any fieldName that starts with "i" or
below (including capitals) works. Can anyone think of what could
possibly be going on here?
On Apr 11, 2005, at 2:27 PM, Bill Tschumy wrote:
In my application, by default I display all documents that are in the
index. I sort them either using a "time modified" or "time created".
If I have a newly created empty index, I find I get an error if I
sort by "time modified" but not "time created". In either case there
are actually no documents that match my query so in reality there is
nothing to sort.
Here is my query:
query = new TermQuery(new Term(MyIndexer.CREATOR_KEY,
MyIndexer.PARSNIPS_VAL));
String fieldName = sortType == Parsnips.SORT_BY_MODIFIED ?
MyIndexer.MODIFIED_KEY : MyIndexer.CREATED_KEY;
Sort sorter = new Sort(new SortField(fieldName, SortField.STRING,
true));
hits = searcher.search(query, sorter);
The error I'm getting when using MyIndexer.MODIFIED_KEY (which is
"modified") as the sort field is:
java.lang.RuntimeException: no terms in field modified
at
org.apache.lucene.search.FieldCacheImpl.getStringIndex(FieldCacheImpl.
java:256)
at
org.apache.lucene.search.FieldSortedHitQueue.comparatorString(FieldSor
tedHitQueue.java:265)
at
org.apache.lucene.search.FieldSortedHitQueue.getCachedComparator(Field
SortedHitQueue.java:180)
at
org.apache.lucene.search.FieldSortedHitQueue.<init>(FieldSortedHitQueu
e.java:58)
at
org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:122)
at org.apache.lucene.search.Hits.getMoreDocs(Hits.java:64)
at org.apache.lucene.search.Hits.<init>(Hits.java:51)
at org.apache.lucene.search.Searcher.search(Searcher.java:41)
at
com.otherwise.parsnips.MySearcher.search(MySearcher.java:170)
at
com.otherwise.parsnips.MySearcher.search(MySearcher.java:149)
at com.otherwise.parsnips.Parsnips.<init>(Parsnips.java:163)
at com.otherwise.parsnips.Parsnips.main(Parsnips.java:1205)
I can't understand why I would be getting this for one sort field but
not the other given there are 0 hits anyway in a newly created index.
Anyone have any thoughts? I am using Lucene 1.4.2.
--
Bill Tschumy
Otherwise -- Austin, TX
http://www.otherwise.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Bill Tschumy
Otherwise -- Austin, TX
http://www.otherwise.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]