cakephp에서 solr 검색을 통합하려고합니다. 모든 것이 잘 작동하지만 mysql 쿼리에 GROUP_CONCATE를 추가하면 내 solr 검색을 인덱싱 할 수 없습니다. 내 코드는 아래에 나열된 코드 solr 검색 색인 검색에서 쉼표로 구분 된 값을 GROUP_CANCAT을 사용하여 생성했습니다.
<dataSource name="db2" type="JdbcDataSource"
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/website"
user="webname"
password="123456"/>
<document name="content">
<entity name="web"
transformer="RegexTransformer"
query="SELECT (SELECT GROUP_CONCAT(name separator ',') FROM tags JOIN article_tags ON tags.id = article_tags.tag_id WHERE article_tags.article_id = article.id) as tagnames,
Article.id, Article.title, Article.sub_title, Article.category_id,
Article.section_title, Article.section_body, Category.id as cat_id,
Category.name as cat_name, Recipe.id as recipe_id, Recipe.recipe_title, ArticleMultiBody.id as multi_id,
ArticleMultiBody.body_title_1, ArticleMultiBody.body_text_1 FROM zahra.articles AS Article
LEFT JOIN zahra.categories AS Category ON (Article.category_id = Category.id)
LEFT JOIN zahra.recipes AS Recipe ON (Recipe.article_id = Article.id)
LEFT JOIN zahra.article_multi_bodies AS ArticleMultiBody ON (ArticleMultiBody.article_id = Article.id) ORDER BY Article.title"
deltaQuery="SELECT Article.id, Article.title, Article.sub_title, Article.category_id, Article.section_title, Article.section_body, Category.id as cat_id, Category.name as cat_name, Recipe.id as recipe_id, Recipe.recipe_title, ArticleMultiBody.id as multi_id, ArticleMultiBody.body_title_1, ArticleMultiBody.body_text_1 FROM zahra.articles AS Article LEFT JOIN zahra.categories AS Category ON (Article.category_id = Category.id) LEFT JOIN zahra.recipes AS Recipe ON (Recipe.article_id = Article.id) LEFT JOIN zahra.article_multi_bodies AS ArticleMultiBody ON (ArticleMultiBody.article_id = Article.id) ORDER BY Article.title">
<field column="ID" name="id" />
<field column="TITLE" name="title" />
<field column="SUB_TITLE" name="sub_title" />
<field column="SECTION_TITLE" name="section_title" />
<field column="SECTION_BODY" name="section_body" />
<field column="CATEGORY_ID" name="category_id" />
<field column="CREATED" name="created" dateTimeFormat="Y-m-d h:i:s" />
<field column="KEYWORDS" name="keywords" splitBy="," sourceColName="tagnames" />
</entity>
</document>
나는 문제가 아래에 나열됩니다.
(SELECT GROUP_CONCAT(name separator ',') FROM tags JOIN article_tags ON tags.id = article_tags.tag_id WHERE article_tags.article_id = article.id) as tagnames,
나는 다음이 코드를 제거 내 SOLR 지수는 아주 잘 작동하지만이를 추가하면 인덱싱 SOLR 동안 얻을 오류 경우 "인덱싱에 실패했습니다. 다시 모든 변경 사항을 압 연."
"tagnames는"새로운 필드가있는 태그 같은 쉼표로 분리 된 값으로 구성 생성 예 : 식품, 건강, 피트니스 등
그래서 난 구분 값