`
topcat
  • 浏览: 284616 次
  • 性别: Icon_minigender_1
  • 来自: 湖北武汉
社区版块
存档分类
最新评论

there are more terms than documents in field "name", but it's impossible to sort

    博客分类:
  • java
阅读更多

在使用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

0
0
分享到:
评论

相关推荐

    A Practical Guide to Designing with Data.pdf

    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 ...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    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...

    计算机网络第六版答案

    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, ...

    Android代码-domino

    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 ...

    Mastering+JavaScript+Functional+Programming-Packt+Publishing(2017).epub

    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...

    Mastering+JavaScript+Functional+Programming-Packt+Publishing(2017).pdf

    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 ...

    Fullstack React - The Complete Guide to React JS and Friends

    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 ...

    Effective Modern C++ 原版pdf by Meyers

    It’s C++, only more so.” But as you learned more, you were surprised by the scope of the changes. auto declarations, range-based for loops, lambda expressions, and rvalue references change the face...

    UE(官方下载)

    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 ...

    a project model for the FreeBSD Project.7z

    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. ...

    Coupled-Field Analysis Guide

    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 ...

    a Practical Theory of Programming 2015-9-19 版

    in it, a specification is a pair of predicates (as in Hoare's Logic), but the second predicate is a relation. Temporal Logic is yet another formalism that introduces some special operators and ...

    There are n cities in M^3's empire. M^3 owns

    There are n cities in M^3's empire. M^3 owns a palace and a car and the palace resides in city 1.

    Universal-USB-Installer

    years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be ...

    Apache Solr [Apache Con 2006]

    Each document consists of a collection of fields, and there are no configuration files required, allowing for dynamic field typing. Lucene provides flexible text analysis using tokenizers and filters...

    The JavaScript Pocket Guide

    So there are LOTS of books you can get as well on JavaScript, but if you already have a basic understanding of JavaScript, most are way more than you need. When your working on something, you just ...

    经典小巧的表格组件 EhLib4.14

     'DBGrids' are necessary in the uses clause, then it is need to move  these strings in place before 'GridsEh' and 'DBGridEh'.  If even in this case you will get error messages about TGridDrawState ...

    EhLib-delphi

     'DBGrids' are necessary in the uses clause, then it is need to move  these strings in place before 'GridsEh' and 'DBGridEh'.  If even in this case you will get error messages about TGridDrawState ...

Global site tag (gtag.js) - Google Analytics