设置shopizer并在tomcat服务器上部署sm-shop.war即预先打包的war文件
根据http://www.shopizer.com/documentation.html#!/,我需要编辑sm-core / src / main / resources / spring / shopizer-search.xml并确保模式是本地的
<property name="mode" value="local"/>
但是,我在webapps下没有看到相应的文件。
我尝试将此search.xml复制到/apache-tomcat-7.0.56/webapps/sm-shop/WEB-INF/spring并重新启动。但是,仍然搜索不起作用。总是返回0结果
日志显示以下错误
at java.lang.Thread.run(Thread.java:745) ERROR: com.salesmanager.web.shop.controller.search.SearchController - Exception occured while querying {"query":{"query_string" : {"fields" : ["name^3", "description", "tags"], "query" : "*mysearch*", "use_dis_max" : true }},"facets" : { "categories" : { "terms" : {"field" : "categories"}}}}
org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected end of subtree [select category
from com.salesmanager.core.business.catalog.category.model.Category category left join fetch category.descriptions as categoryDescription left join fetch category.merchantStore where category.code in () and category.merchantStore.id = :a2 and categoryDescription.language.id = :a2 order by category.sortOrder asc, category.lineage asc, category.lineage asc, category.depth asc, categoryDescription.language.id desc]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected end of subtree [select category from com.salesmanager.core.business.catalog.category.model.Category category left join fetch category.descriptions as categoryDescription left join fetch category.merchantStore
答案 0 :(得分:1)
关于弹性搜索,文件将在工作中。因此,如果您从eclipse运行,则会有一个包含索引的shopizer文件夹。如果您是直接从Tomcat部署,则必须找出磁盘上的容器工作目录,您将在其中找到索引。在您的情况下,似乎搜索配置是ik
现在您遇到的异常似乎与错误的类别配置有关,您可能需要修改结构。我建议你从一个类别和一个产品开始,尝试从那里搜索并掌握这个概念