如何访问OpenSearchServer数据库字段? [英] How do I access OpenSearchServer database fields?

查看:165
本文介绍了如何访问OpenSearchServer数据库字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用OpenSearchServer v1.2.4。我想访问OpenSearchServer数据库字段像自动完成或拼写检查等。我该怎么做? OpenSearchServer api仅通过XML提供标题,元,URL字段和一些其他字段。请建议我查询/搜索模式以获得自动填充字段。

解决方案

您可以通过编辑查询轻松控制返回的字段。


$ b

激活拼写检查,编辑搜索查询并转到拼写检查选项卡面板。
如果使用Web模板,请使用字段contentExact或titleExact。拼写检查模块将通过提取此字段中存在的单词来构建字典。有三种算法可用:Levensthein,Jaro-Winkler,NGramDistance。



一旦设置了拼写检查设置并保存了查询,您就可以使用它使用XML over HTTP API。大多数时候,XML将包括拼写检查建议。您必须决定何时向用户显示建议。


$ b

自动完成

自动填充字段的作用是收集索引文档(网页)中的所有可用表达式。



以下是构建自动完成功能的常见方法:




  • 使用以下字段创建新的空索引:




    • >使用以下参数为表达式字段创建文本分析器:

      • Tokenizer:StandardTokenizer

      • 在过滤器列表中,

        • a LowerCaseFilter

        • a EgdeNGramFilter(Min gram size:1 - Max gram size:50 - Edge side:front)



    • 创建调度程序作业。它将以定期间隔(例如:每天一次)用收集的表达式填充新索引。典型的任务和参数是:

      • 添加删除查询任务:查询:

      • 添加Pull terms任务:

        • 源字段名称:autocomplete

        • 索引源:网络索引的名称

        • 字词名称:表达式

        • 频率栏位名称:freq

        • 最低频率:1

        • 频率盘:9


      • 添加索引优化任务。


    • 使用以下参数创建新请求:

      • 模式查询:expression:($$)

      • 返回字段:表达式

      • 排序字段:频率降序,分数递减


    • 使用新查询集成自动完成用户界面。


    I am using OpenSearchServer v1.2.4. I want to access OpenSearchServer database field like "autocomplete" or Spell check etc. How Can i do that? The OpenSearchServer api only provides title, meta, url fields and some others via XML. Please suggest me query/search pattern to get autocomplete field.

    解决方案

    You can easily control the returned fields by editing the query. To do that, go to the query tab panel.

    Spellchecking

    To activate the spellcheck, edit the "search" query and go to the spellcheck tab panel. If you are using the web template, use the field "contentExact" or "titleExact". The spellcheck module will build a dictionary by extracting the words present in this field. There is three algorithms available: Levensthein, Jaro-Winkler, NGramDistance.

    As soon as you have set up the spellcheck settings and saved the query, you will be able to use it using the XML over HTTP API. Most of the time, the XML will include spellcheck suggestions. You have to decide when you show the suggestion to the users. You may display the suggestions when the search returns no document.

    Autocompletion

    The role of the "autocomplete" field is to collect all the expressions available in the indexed documents (web pages).

    Here is a common way to build an autocompletion feature:

    • Create a new empty index with the following fields:
      • Expression: indexed, stored, the analyzer describer in the next point.
      • freq: indexed, not stored.
    • Create a text analyzer for the expression field, with the following parameters:
      • Tokenizer: StandardTokenizer
      • In the filter list, add:
        • a LowerCaseFilter
        • a EgdeNGramFilter (Min gram size: 1 - Max gram size: 50 - Edge side: front)
    • Create a sheduler job. It will populate the new index with the collected expressions at regular interval (Example: once a day). The typical task and parameters are:
      • Add a "Delete query" task: Query::
      • Add a "Pull terms" task:
        • Source field name: autocomplete
        • Index source: The name of the web index
        • Term field name: expression
        • Frequency field name: freq
        • Minimum frequency: 1
        • Frequency pad: 9
      • Add an "Index - optimize" task.
    • Create a new request with the following parameters:
      • Pattern query: expression:($$)
      • Returned field: expression
      • Sorted fields: freq descending, score descending
    • Integrate the autocompletion user interface by using the new query.

    这篇关于如何访问OpenSearchServer数据库字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆