A SearchParameters object allows the specification of:
SearchParameters对象允许指定:

  • the search language
  • the search string
  • the definition of the fields ALL and TEXT
  • the locale(s)
  • bulk fetching of nodes from hibernate that are included in the results
  • default AND or OR behavior
  • the properties to be returned by the query
  • query parameters
  • sorting
  • a limit to the size of the result set
  • a limit to the number of permission evaluations carried out
  • the generation of additional tokens for multilingual components of searches
  • which store to search
  • the transactional isolation level to use for the search
  • 搜索语言
  • 搜索字符串
  • ALL和TEXT的定义
  • 区域设置
  • 从hibernate批量获取结果中包含的节点
  • 默认AND或OR行为
  • 查询要返回的属性
  • 查询参数
  • 排序
  • 结果集大小的限制
  • 对权限评估次数的限制
  • 为搜索的多语言组件配置分词器
  • 搜索对象store
  • 用于搜索的事务隔离级别

Currently, the supported search languages are:
目前,支持的搜索语言有:

  • Lucene
  • XPath

The specification of the search language to use is case insensitive.
搜索语言规范使用时不区分大小写。

The search string depends on the query language. Examples are given for each supported query language.
搜索字符串取决于查询语言。示例中给出了每种支持的查询语言。

The data to search is specified by selecting which store to search. At present, this is restricted to a single store.
通过选择要搜索的store来指定要搜索的数据。目前,只能指定一个store。

Query parameters define and substitute values into queries. The definition of query parameters depends on the query language. Examples are given for each supported query language.
查询参数定义值并将其替换为查询。查询参数的定义取决于查询语言。示例中给出了每种支持的查询语言。

The results from a search can be sorted using any property that can be recovered direct from the nodes that are found, but not properties of ancestors or dependents. There are special keys to sort by index order and relevance/score. By default search results are returned with the most relevant (such as highest score) first.
搜索结果可以使用节点的任何属性进行排序,但不能使用先祖或从属节点的属性。有按索引顺序和相关性/分数排序的特殊键。默认情况下,搜索结果将首先返回最相关的结果(例如最高分数)。

The maximum size of the result set can be set. The return results set will be no bigger than this size.
可以设置结果集的最大大小。返回结果集将不大于此大小。

The maximum number of permission evaluations may also be set. Only this number of nodes will be considered for inclusion in the results set. If you set this to 10,000 and you do not have read permission for the first 10,000 things, you will see no results even though there may be a 10,001 node which you can see.
还可以设置许可评估的最大数量。只考虑将此数量的节点包含在结果集中。如果将此值设置为10000,但是您没有前10000个对象的读取权限,则即使您有权限访问第10001节点,也不会看到任何结果。

There is a time constraint applied to permission evaluations. This is set in the repository configuration, not on the QueryParameters.
对权限评估应用了耗时限制。这是在存储库配置中设置的,而不是在QueryParameters上设置的。

The transactional isolation determines if the search sees information changed in the transaction or not. It will see all other data committed by other transactions. In database terms, the default behavior is READ_COMMITTED. If data changes made in the transaction are excluded from the search, data from all committed transactions will be found, excluding changes in the current transaction.
事务隔离确定搜索是否看到事务中的信息更改。它将看到其他事务提交的所有其他数据。在数据库术语中,默认行为是READ_COMMITTED。如果搜索中排除了在事务中所做的数据更改,则将找到所有已提交事务中的数据,不包括当前事务中的更改。

ALL and TEXT can be defined by the user.
ALL和TEXT可以由用户定义。

The locale or locales are used to match the node locale — the locale of content and the locale of multi-lingual text properties. If there is more than one locale, query components are generated for each locale and tokenized accordingly.
区域设置用于匹配节点区域设置-内容的区域设置和多语言文本属性的区域设置。如果有多个区域设置,则为每个区域设置生成查询组件,并相应地进行分词。

There is no default filter for locale, primarily as locale is not present for most nodes. Non-localised properties (those which are not of type d:content or d:mltext) may exhibit unexpected behaviour when a node is not localised. The locale is found, in order of preference, from the node, from a thread local as set by the UI etc, and then from the Java default. If the thread local locale differs from the system default then tokenisation may change between initial index of a document and subsequent background FTS index (when there is no thread local locale). To avoid this in multi-lingual environments use a consistent tokenisation approach across all languages.
没有区域设置的默认筛选器,主要是因为大多数节点不存在区域设置。非本地化属性(那些不是d:content或d:mltext类型的属性)在节点未本地化时可能会出现意外行为。按照优先顺序,可以从节点、UI等设置的本地线程,然后从Java默认值中找到区域设置。如果线程本地语言环境与系统默认语言环境不同,则标记化可能会在文档的初始索引和后续的后台FTS索引之间发生变化(当没有线程本地语言环境时)。为了避免在多语言环境中出现这种情况,在所有语言中使用一致的分词方法。

文档更新时间: 2020-02-10 16:14   作者:凌云文档