问题描述
我将该项目编入solr。在该项目中,我在列中存储了产品型号列表。我不知道如何从Solr检索该数据。我想要的是从solr获取数据的步骤。像从控制器到控制器如何实现
<collectiontypes>
<collectiontype code="topsellingproductscodes" elementtype="Product" autocreate="true" type="list"/>
</collectiontypes>
<itemtype code="TopSoldProducts">
<deployment table="TopSoldProducts" typecode="23677"/>
<attributes>
<attribute qualifier="products" type="topsellingproductscodes">
<persistence type="property" />
</attribute>
</attributes>
</itemtype>
used this impex to indexed the data into solr:
$siteUid=apparel-uk
$catalogVersions=catalogVersions(catalog(id),version);
$productCatalog=apparelProductCatalog
$serverConfigName=$siteUid SolrserverConfig
$indexConfigName=$siteUid SolrIndexConfig
$searchConfigName=$siteUid PageSize
$facetSearchConfigName=$siteUid
$facetSearchConfigDescription=top selling products solr index
$searchIndexNamePrefix=topsellingproductscodes
$solrIndexedType=$siteUid-TopSellingProducts
$indexBaseSite=$siteUid
$indexLanguages=en
$indexCurrencies=GBP
$lang=en
# Declare the indexed type MyEmployee
INSERT_UPDATE SolrIndexedType;identifier[unique=true];type(code);variant
;$solrIndexedType;TopSoldProducts;false
#Adding top Selling Products into facet search config
INSERT_UPDATE SolrFacetSearchConfig;name[unique=true] ;description ;indexNamePrefix ;languages(isocode);currencies(isocode);solrserverConfig(name);solrsearchConfig(description);solrIndexConfig(name);solrIndexedTypes(identifier);enabledLanguageFallbackMechanism;$catalogVersions;;;;;;;;;
;$facetSearchConfigName;$facetSearchConfigDescription;$searchIndexNamePrefix;$indexLanguages ;$indexCurrencies ;Default ;Default;Default;$solrIndexedType;true;$productCatalog:Online;;;;;;;;;
# Create the queries that will be used to extract data for Solr
INSERT_UPDATE SolrIndexerQuery;solrIndexedType(identifier)[unique=true];identifier[unique=true];type(code);injectCurrentDate[default=true];injectCurrentTime[default=true];injectLastIndexTime[default=true];query;user(uid)
;$solrIndexedType;$solrIndexedType-fullQuery;full;;;false;"select {pk} from {topSoldProducts}";anonymous
;$solrIndexedType;$solrIndexedType-updateQuery;update;;;;"select {tsp.pk} from {topSoldProducts as tsp} where {modifiedtime}>=?lastIndexTime";anonymous
INSERT_UPDATE SolrIndexedProperty;solrIndexedType(identifier)[unique=true];name[unique=true];type(code) ;sortableType(code);localized[default=false];multiValue[default=false];facet[default=false];facetType(code);facetSort(code);priority ;visible ;fieldValueProvider ;includeInResponse[default=true];backofficedisplayName
;$solrIndexedType ;products ;string ; ; ;true ; ; ;Custom ;1000 ;true ;topSoldProductsValueProvider ; ;topSoldProducts Prefix
在此之后,我对索引进行了完整的索引。 如何从solr检索此数据。 预先感谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)