gpt4 book ai didi

MySQL 数据库在 Apache Solr 上建立索引,如何通过 URL 访问它

转载 作者:行者123 更新时间:2023-11-29 13:29:56 25 4
gpt4 key购买 nike

data-config.xml

<dataConfig>
<dataSource encoding="UTF-8" type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/somevisits" user="root" password=""/>
<document name="somevisits">
<entity name="login" query="select * from login">
<field column="sv_id" name="sv_id" />
<field column="sv_username" name="sv_username" />
</entity>
</document>
</dataConfig>

schema.xml

<?xml version="1.0" encoding="UTF-8" ?>
<schema name="example" version="1.5">
<fields>
<field name="sv_id" type="string" indexed="true" stored="true" required="true" multiValued="false" />
<field name="sv_username" type="string" indexed="true" stored="true" required="true"/>
<field name="_version_" type="long" indexed="true" stored="true" multiValued="false"/>
<field name="text" type="string" indexed="true" stored="false" multiValued="true"/>
</fields>
<uniqueKey>sv_id</uniqueKey>
<types>
<fieldType name="string" class="solr.StrField" sortMissingLast="true" />
<fieldType name="long" class="solr.TrieLongField" precisionStep="0" positionIncrementGap="0"/>
</types>
</schema>

Solr使用完整http://[localSolr]:8983/solr/#/collection1/dataimport?command=full-import成功导入mysql数据库

我的问题是,现在如何访问mysql导入的数据库?

最佳答案

如果您想搜索索引数据,则以下是用于搜索索引数据的 URL。

http://[localSolr]:8983/solr/CORE_NAME/admin

这将打开搜索界面。默认情况下,搜索字符串为 :,它将给出所有索引文档作为结果。这里第一个 * 代表字段名称,第二个 * 代表关键字。您可以搜索特定字段的特定字符串,即 username:USERNAME 或 sv_id:YOURID。或者,如果您只提供关键字而不提供任何字段名称“mykeyword”,那么它将在您的默认搜索字段中搜索该关键字。

关于MySQL 数据库在 Apache Solr 上建立索引,如何通过 URL 访问它,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19617331/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com