Sending data: upload from WS ● Example with shell script export HOST =bo-store.afs-antidot.net � export FILE =20151016_full_foobar_catalog.zip � export SERVICE_ID =42 � export STATUS =rc � export PAF_NAME =Catalog � export LOGIN =login://user:password@BOWS � export UPLOAD_TYPE =full � … curl � -H Expect: � --form file1="@ ${FILE} " � "https:// ${HOST} /bo-ws/service/ ${SERVICE_ID} /instance/ ${STATUS} / paf/ ${PAF_NAME} / upload ?afs:login= ${LOGIN} &afs:type= ${UPLOAD_TYPE} " � -X POST � … 62
Sending data: upload from WS ● Can also be used in php, python, etc. ● Example at Antidot ● Python WS API ● Upload data ● Run processing pipelines ● Wait for pipeline to end ● … 63
AFS@Store Data model in details 64
AFS@Store data model ● AFS@Store relies on a speci fi c vocabulary de fi ned by Antidot and expressed as XML Schemas ● Each xml fi le (a.k.a feed) sent as input must conform to these schemas. ● Failed documents won’t be indexed. That condition ensures the search engine quality. ● It’s also a check to avoid the update of an index with less than 95% of input products valids. 65
Data feed header ● Common to all the AFS@Store feeds. ● Xml fragment de fi ning minimum details about data fi le. <header> � � <owner>Antisearch</owner> � � <feed>parapharmacy</feed> � � <generated_at>2011-07-19T15:37:41+02:00</generated_at> � </header> � 66
Catalog data format ● 5 feeds availables ● Catalog (mandatory) ● Categories ● Brands ● Articles ● Stores 67
Catalog: what are variants ? ● Variants are SKU which share common characteristics. These de fi ne a main product. Tshirt ¡A ¡ S ¡ M ¡ S ¡ L ¡ M ¡ ● Tshirt Tshirt A A is the product; white one in S and L, red one and green ones are its variants. 68
Catalog: what are variants ? ● Variants may be speci fi c for prices, colors, sizes, stock, custom attributes (properties) ● Only matching variants will be returned by search ● Facets will list the values for the matching variant, while showing the product model. ● Example: TshirtA is available on colors white, red, green, and on sizes S, M, L 69
Catalog context ● Language is an atomic context, su ffi cient if you have only one website per language ● Use website tes for a simple fi lter for search and acp ● Use sto tores when price, availability or marketing depends of physical or virtual stores ● Examples ● Drives support: use one store per physical shop, plus one for web shop ● Multiple countries context: use stores (one per country) ● Store is available at product product or va variant level 70
Catalog fi elds ● Autocompletion must be explicitely enabled ● <product id="70551" xml:lang="fr" autocomplete="on"> ● Identi fi ers ● Extendable products codes ● Classi fi cation ● See further section ● Properties ● See further section ● Descriptions ● Extendable plain text descriptions ● Marketing operations ● See further section ● Price model ● See further section ● Misc ● Free fi elds, not indexed, only for display purposes 71
Catalog – classi fi cation ● Hierarchy and multiple values supported ● Use img, url and keywords attributes for ACP ● Autocompletion enabled by default ● It can use a speci fi c setting that will enable match on brand which contains these categories ● Example: <classi fi cation autocomplete="cross"> ● ACP feed will be named: ● categories_[websiteId]_[lang] 72
Catalog – properties ● Allows to create facets ● name and label ● string, date, numeric ● tree or interval (numeric only) ● A property can become an acp feed with custom meta data (cf. examples from AFS@Store integration guide ) ● ACP feed will be named: ● property_[propertyName]_[websiteId]_[lang] 73
Catalog – marketing operations ● Very important to get merchandizing into search and acp ● Search: fi lters and sort criteria, marketing facet ● ACP: automatic boost ● Available operations: ● is_promotional ● is_new ● Is_best_sale ● is_featured ● operation (custom) 74
Catalog – price model ● Price fi nal ● Price cut only for promotional items ● Several attributes: ● currency (mandatory): automatic facet per currency ● o ff : discount percentage, will create automatic facet (price_o ff ), meta data for product acp and use in acp scoring ● Quantities ● Price ranges per quantity 75
Categories data format ● 5 feeds availables ● Catalog (mandatory) ● Categories ● Brands ● Articles ● Stores 76
Categories data format ● Use broader to link categories ● Use websites to contextualize (url, products count, …) ● Add keywords for broader matching ● Autocompletion must be explicitely enabled if needed: <category id="99998" xml:lang="fr" autocomplete=”on"> ● ACP feed will be named: ● categories_pages_[websiteId]_[lang] ● ACP di ff erences versus categories feed from Catalog ● Contains all landing pages, products count ● Can not be crossed with brands 77
AFS@Store Features ● 5 feeds availables ● Catalog (mandatory) ● Categories ● Brands ● Articles ● Stores 78
Brands data format ● Same as Categories, but: ● No broader element ● Autocomplete not yet supported 79
AFS@Store data format ● 5 feeds availables ● Catalog (mandatory) ● Categories ● Brands ● Articles ● Stores 80
Articles data format ● Autocompletion enabled by default on title ● Support ACP on classi fi cation node ● ACP feed will be named: ● articles_[websiteId]_[lang] ● articles_classi fi cation_[websiteId]_[lang] ● Important fi elds ● text : main raw article content ● type : allows search clustering and acp fl ag ● websites : fi lter for search and acp ● classification : same features as Catalog ● interaction_counts : extendable sort criteria ● dates : sort criteria 81
AFS@Store data format ● 5 feeds availables ● Catalog (mandatory) ● Categories ● Brands ● Articles ● Stores 82
AFS@Store data format ● Autocompletion enabled by default ● ACP feed will be named: ● stores_[websiteId]_[lang] ● Support for geo:dist enabled with longitude and latitude fi elds ● Support for websites as a fi lter (no contextualization) ● Others fi lters: ● is_shipping_target � ● country � ● Allows free fi elds within misc element 83
AFS@Store Tutorial 84
AFS@Store features ● Tutorial 1) From e-commerce website, create te an AFS@Store sample for the Cata talog feed 2) 2) Validate te the sample with provided xsd 3) 3) Add Add more elements to the sample : facets, misc, … 4) According to the fi lename policy : rename xml, zip it, rename zip and upload upload to the given directory 85
AFS@Store Ready to use ! 86
AFS@Store output ● Live example 87
AFS@Store output ● Raw XML or XSL skin 88
AFS@Store Search API 89
Search ● Parameters list ● afs:query ● afs:sort ● afs: fi lter ● afs:cluster ● afs:tag ● … ● cf. AFS@Store online integration guide : Search Service > Query Syntax 90
AFS@Store Tutorial – Search parameters 91
Search ● Go to the given URL ( http://eval.partners.antidot.net/search?afs:service=7006 ) ● Launch the query “ fl eur". ● Sort the results by ascending price (predicate name : ”price_eur”) Query : ...................................................................................................... ● From the previous request, fi lter results via the classi fi cation fi lter with the “10006" value. Query : ...................................................................................................... ● Launch a new query : “croquettes". ● Cluster results by brand with 2 replies by clusters, and add a tag ”Bargain price" when the price value is less than 4. Query : ...................................................................................................... 92
Search ● Tutorial (2/2) ● Launch the query “Tuteurs Bambou" in strict ftsMatch mode, ● Keep only facets values in french Query : ...................................................................................................... ● Launch a query on “sachets pour chats”, ● Filter on items which are between 6 and 20 € , which brand value is “FELIX” or “SCIENCE PLAN” ● Hide all the facets Query : ...................................................................................................... ● Search "boite", keep only the brand and classi fi cation facets, display classi fi cation facet before brand , reorder the values of brand facets by reversed alphabetical order, and get the result of the query in JSON. Query : ...................................................................................................... 93
Search ● Correction (1/2) ● Launch the query “ fl eur". ● Sort the results by ascending price (predicate name : ”price_eur”) Query : http://<IP>/search?afs:service=7006&afs:query= fl eur&afs:sort afs:sort=price_eur,ASC price_eur,ASC ● From the previous request, fi lter results via the classi fi cation fi lter with the “10006" value. Query : http://<IP>/search? afs:service=7006&afs:query= fl eur&afs:sort=price_eur,ASC&afs: fi lter=classi fi fi cati tion="1 "10 006" " ● Launch a new query : “croquettes". ● Cluster results by brand with 2 replies by clusters, and add a tag ”Bargain price" when the price value is less than 4. Query : http://<IP>/search?afs:service=7006&afs:query=croquettes&afs:cluste ter=brand, =brand, 2&afs:ta tag="Ba Bargain price price": ":price_eur price_eur<4 <4 94
Search ● Correction (2/2) ● Launch the query “Tuteurs Bambou" in strict ftsMatch mode, ● Keep only facets values in french Query : http://<IP>/search?afs:service=7006&afs:query=Tuteurs Bambou&afs:fts tsMatc tch=str trict&afs:lang afs:lang=fr fr ● Launch a query on “sachets pour chats”, ● Filter on items which are between 6 and 20 € , which brand value is “FELIX” or “SCIENCE PLAN” ● Hide all the facets Query : http://<IP>/search?afs:service=7006&afs:query=sachets pour chats&afs: fi fi lte ter=price_eur price_eur=[6 .. 20] =[6 .. 20]&afs: fi fi lte ter=(b (brand="FE "FELIX IX" " or brand="S "SCIE IENCE PL PLAN") ")&afs:facetD tDefault=replies=0 =replies=0 ● Search "boite", keep only the brand and classi fi cation facets, display classi fi cation facet before brand , reorder the values of brand facets by reversed alphabetical order, and get the result of the query in JSON. Query : http://<IP>/search? afs:service=7006&afs:query=boite&afs:facetO tOrder=classi fi fi cati tion,brand&afs:facet afs:facet=brand =brand , , order order=DESC DESC&afs:outp tput=json json 95
AFS@Store Search integration 96
AFS@Store PHP API 97
PHP API ● PHP library used to interact with AFS search engine ● Open source: https://github.com/antidot/PHP_API ● Documentation: http://antidot.github.io/PHP_API/doc/html/ ● Release notes: http://doc-store.antidot.net/ > "Publications" Tab > API PHP Release Notes 98
PHP API ● Common packages (required) ● php5 ● php5-cgi ● php5-curl ● Load the library 99
PHP API – Principle ● Relies on two main objects (Query and Reply) designed like this: query afs_lib.php AFS search.php API reply 100
Recommend
More recommend