在使用solr的排序时出现了类似下面的异常:
there are more terms than documents in field "name", but it's impossible to sort on tokenized fields
name在solr中为text型字段
根据
http://lucene.apache.org/java/3_0_0/api/core/org/apache/lucene/search/Sort.html
Encapsulates sort criteria for returned hits.
The fields used to determine sort order must be carefully chosen. Documents must contain a single term in such a field, and the value of the term should
indicate the document's relative position in a given sort order. The field must be indexed, but should not be tokenized, and does not need to be stored
(unless you happen to want it back with the rest of your document data). In other words:
document.add (new Field ("byNumber", Integer.toString(x), Field.Store.NO, Field.Index.NOT_ANALYZED));
的描述,sort的字段是"should not be tokenized",而solr中的配置是对text字段进行了tokeniz了的因此会出现类似下面的异常:
there are more terms than documents in field "name", but it's impossible to sort on tokenized fields
这里是nabble上一个用户关于这方面的问题
http://old.nabble.com/Exception-when-field-sort.-td21302894.html
分享到:
相关推荐
解决docker报错There are no more lookback devices available
Itʼs impossible to look at a table of fifteen petabytes of information – there has to be a graphical representation for anyone to comprehend data at this volume. This is what excites me: the ...
puters, there are even more algorithms, and algorithms lie at the heart of computing. This book provides a comprehensive introduction to the modern study of com- puter algorithms. It presents many ...
However, there are no books that look systematically at the gap separating the theory of algorithms and software engineering, even though many things can go wrong in taking several algorithms and ...
When it comes to programmatically accessing Microsoft's Active Directory a lot of people seem to have quite a difficult time tying all the pieces together to accomplish exactly what they want to....
A name is always resolved relative to a context — there are no absolute names. Because a context is like any other object, it can also be bound to a name in a naming context. Binding contexts in ...
In some cases there might be good arguments for changing certain style rules, but we nonetheless keep things as they are in order to preserve consistency. Another issue this guide addresses is that...
解决there are inconsistent line endings
but the time when loss first occurs will be different from one experiment to the next due to the randomness in the emission process. 22. Five generic tasks are error control, flow control, ...
Domino pieces and game state is working OK, but there are more than a few things missing. First, it's not very pretty. It's in OpenGL, although the perspective is fixed and not very appealing. I ...
It's easy to apply a given function from some package or other, but by coding everything out (a vanilla FP, if you wish), it's my belief that you get to understand things more deeply. Also, as I will...
and connecting them in simple ways to produce more understandable and more easily tested code. Thus, given the increased complexity of today's web applications, it's logical that a safer, cleaner way ...
“People will come to expect that injured or diseased organs are meant to be repaired from within, in much the same way that we fix an appliance or automobile: by replacing the damaged part with a ...
With such an active community, there are so many updates it feels impossible to know about what's best and what's just noise. How does it all fit together? React is a modular ecosystem but API docs ...
are used for displaying the country name in the 'Remote IP Country' column. * Version 1.92: o When choosing 'Clear Log File' option, CurrPorts now asks you whether you want to clear the log, in ...
Locker doors There are n lockers in a hallway numbered sequentially from 1 to n. Initially, all the locker doors are closed
Have you ever built a complex Perl-style regular expression, only to find that it matches much more data than you anticipated? If you've ever found yourself pulling your hair out trying to build the ...
As of this writing, there are more than 12600 ports available. [2] , ranging from web servers to games, programming languages and most of the application types that are in use on modern computers. ...
field introduces thermal strains in the structural field, but the structural strains generally do not affect the temperature distribution. Thus, there is no need to iterate between the two field ...