Cloud Stack Ninja

i indexed the item into solr. in that item I stored a list of product models in a column. i dont know how to retrive that data from solr. what i want is steps to get that data from solr. like from controller to solr how can achieve it

<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

after this i did a full indexing the products are comming in solr. how can retrive this data from solr. thanks in advance.



Read more here: https://stackoverflow.com/questions/64366246/how-to-retrive-data-from-solr-i-have-a-item-that-holds-the-list-product-model-h

Content Attribution

This content was originally published by mani sanakar at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: