1

我将项目索引到 solr。在那个项目中,我在一列中存储了一个产品型号列表。我不知道如何从 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 中。如何从 solr 中检索这些数据。提前致谢。

4

0 回答 0