Apachesolr drupal 方面断为多行

发布于 2024-12-09 13:29:40 字数 881 浏览 1 评论 0原文

我在 drupal 中使用 apachesolr 模块
我创建了一个自定义构面字段主题,但在drupal构面块中,该句子在多行/结果中中断
例如科目分析化学将是
1
1

我有表journal、subject、subject_journal 和article
我的数据配置文件有实体

<entity name="subject" pk="id"
                    query="select s.id, s.title from subject s
                            join subject_journal sj on sj.subject_id = s.id
                            join article a on a.journal_id = sj.journal_id
                            where sj.journal_id = '${article.journal_id}' 
                            group by s.id, s.title">
                    <field column="id" name="subject_id" /> 
                    <field column="title" name="subject" />                         
        </entity>

请帮忙
谢谢

I am using apachesolr module in drupal
I have created a custom facet field subject but in drupal facet block, the sentence is breaking in multiple line/result
for example the subject Analytical chemistry would be
<int name="analyt">1</int>
<int name="chemistri">1</int>

I have tables journal, subject, subject_journal and article
My data config file has entity

<entity name="subject" pk="id"
                    query="select s.id, s.title from subject s
                            join subject_journal sj on sj.subject_id = s.id
                            join article a on a.journal_id = sj.journal_id
                            where sj.journal_id = '${article.journal_id}' 
                            group by s.id, s.title">
                    <field column="id" name="subject_id" /> 
                    <field column="title" name="subject" />                         
        </entity>

Please help
Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我一直都在从未离去 2024-12-16 13:29:40

您似乎正在对您的方面领域进行分析。

一般分面字段详细信息 -

分面字段通常指定用于两个目的,即人类可读的文本和深入查询值,它们的索引通常与用于搜索和排序的字段不同:

它们通常不会标记为单独的单词
它们通常不会映射为小写字母
人类可读的标点符号通常不会被删除(双引号除外)
通常不需要存储它们,因为存储的值看起来很像索引值,并且分面机制用于值检索。

您应该为构面字段维护一个单独的副本,并且不对它执行任何分析,并将其用作构面字段。

<field name="subject" type="text_general" indexed="true" stored="true" multiValued="true"/>
<!-- Maintain different facet field -->
<field name="subject_facet" type="string" indexed="true" stored="true" multiValued="true"/>

<!-- copy field -->
<copyField source="subject" dest="subject_facet"/>

you seem to be performing analysis on your facet field.

General facet field detail -

Faceting fields are often specified to serve two purposes, human-readable text and drill-down query value, they are frequently indexed differently from fields used for searching and sorting:

They are often not tokenized into separate words
They are often not mapped into lower case
Human-readable punctuation is often not removed (other than double-quotes)
There is often no need to store them, since stored values would look much like indexed values and the faceting mechanism is used for value retrieval.

you should maintain a seperate copy for the facet field and perform no analysis on it, and use that as the facet field.

<field name="subject" type="text_general" indexed="true" stored="true" multiValued="true"/>
<!-- Maintain different facet field -->
<field name="subject_facet" type="string" indexed="true" stored="true" multiValued="true"/>

<!-- copy field -->
<copyField source="subject" dest="subject_facet"/>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文