> For the complete documentation index, see [llms.txt](https://tech.x2bee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tech.x2bee.com/dev-guide/developer-guide-en/dev-start/search-and-other-environment-settings/search-and-indexing.md).

# Search and Indexing

This document covers how to use the search engine.\
First, it explains how to add search data.\
Second, it explains how to query search data.

### Adding Search Data

* When Python starts, the search data indexes all product data existing in the DB, and changed product data is updated via batch.
* If you want to add data other than what's in the DB, you can add it by making a query request in the manner of the example below.

**Query Request (Example)**

{% code title="url : <http://43.200.20.154:3001/searchDataInsert> method : POST body : \[{ "goods\_no" : "10001881", "entr\_no" : "10000021111", "goods\_comp\_cd" : "10", "goods\_typ\_cd" : "10", "sale\_meth\_cd" : "10", "brand\_no" : "100002", "buyr\_age\_lmt\_cd" : "15", "disp\_yn" : "Y", "sale\_stat\_cd" : "10", "goods\_reg\_dtm" : "2023-06-19T21:13:52.764870", "sale\_str\_dtm" : "2023-06-19T00:00:00", "sale\_end\_dtm" : "2999-12-31T23:59:59", "stk\_mgr\_yn" : "Y", "deli\_proc\_typ\_cd" : "20", "deli\_goods\_gb\_cd" : "01", "deli\_way\_cd" : "01", "deli\_dday" : 1, "deli\_polc\_no" : "10000009", "prc\_hist\_str\_dtm" : "2023-06-19T21:13:52.798920", "prc\_hist\_end\_dtm" : "2999-12-31T23:59:59", "rcnt\_sale\_prc" : 2000, "sale\_prc" : 1110, "aply\_prc" : 1070, "dc\_rate" : 46, "disp\_ctg\_no" : "212", "dlex\_typ\_cd" : "30", "goods\_immed\_dc\_cpn\_no" : "10001881", "goods\_immed\_dc\_aply\_str\_dtm" : "2023-06-24T10:12:00", "goods\_immed\_dc\_aply\_end\_dtm" : "2023-07-23T23:59:59", "goods\_rep\_img\_cont\_sn" : "", "rserv\_sale\_yn" : "N", "rserv\_str\_dtm" : null, "rserv\_end\_dtm" : null, "goods\_rev\_cnt" : 65, "goods\_rev\_hlpful\_cnt" : 949, "goods\_rev\_starscr\_avg\_val" : 1.49, "wish\_list\_cnt" : 23, "lang\_cd" : "ko", "goods\_nm" : "단일상품6", "adve\_wrd" : null, "prest\_nm" : null, "brand\_nm" : "멀버리", "sch\_kwd\_nm" : "123,3445", "brand\_img\_path\_nm" : "<https://img-stg.x2bee.com/attachment/goods/2023/06/24/513c45e1-1de5-492e-85cb-a62766fae2dc\\_10.png>", "brand\_img\_file\_nm" : "2023-06-24 19 46 37.png", "goods\_rep\_img\_path\_nm" : "<https://img-stg.x2bee.com/attachment/goods/2023/06/20/905d6c1b-4a63-409d-8009-81df104dd1d3\\_10.jpg>", "goods\_dtl\_desc" : "

l;'l;'l'kl;'kl;

" }]" %}

```
```

Example Request URL and Method

* URL: <http://43.200.20.154:3001/searchDataInsert>
* method: POST

### Querying Search Data

* Product data can be queried by sending a `searchWords` value to the endpoint below.\
  URL: <http://43.200.20.154:3001/esTypeX2beeSearch>
* Fields currently matched by the search term:
  * goods\_nm
  * adve\_wrd
  * prest\_nm
  * brand\_nm
  * sch\_kwd\_nm
  * goods\_dtl\_desc

**Data Query (Example)**

{% code title=" public List goodsSearch(SearchSampleRequest searchSampleRequest) throws Exception { List SearchSampleResponse = restApiUtil.get("<http://43.200.20.154:3001/esTypeX2beeSearch>", searchSampleRequest, new ParameterizedTypeReference\<Response\<List>>() {}).getPayload();

```
    return SearchSampleResponse;
}" %}
```

```
```

**Response Example (JSON)**

{% code title="{ "payload": \[ { "goods\_no": "10001971", "entr\_no": "1000002", "goods\_comp\_cd": "20", "goods\_typ\_cd": "10", "sale\_meth\_cd": "10", "brand\_no": "10051", "buyr\_age\_lmt\_cd": "0", "disp\_yn": "Y", "sale\_stat\_cd": "10", "goods\_reg\_dtm": "2023-06-22T17:45:51.447011", "sale\_str\_dtm": "2023-06-23T00:00:00", "sale\_end\_dtm": "2999-12-31T23:59:59", "stk\_mgr\_yn": "N", "deli\_proc\_typ\_cd": "20", "deli\_goods\_gb\_cd": "01", "deli\_way\_cd": "01", "deli\_dday": 3, "deli\_polc\_no": "10000020", "prc\_hist\_str\_dtm": "2023-07-11T20:03:34.778747", "prc\_hist\_end\_dtm": "2999-12-31T23:59:59", "rcnt\_sale\_prc": 2000, "sale\_prc": 1110, "aply\_prc": 1070, "dc\_rate": 46, "disp\_ctg\_no": "212", "dlex\_typ\_cd": "10", "goods\_immed\_dc\_cpn\_no": null, "goods\_immed\_dc\_aply\_str\_dtm": null, "goods\_immed\_dc\_aply\_end\_dtm": null, "goods\_rep\_img\_cont\_sn": "", "rserv\_sale\_yn": "N", "rserv\_str\_dtm": null, "rserv\_end\_dtm": null, "goods\_rev\_cnt": 58, "goods\_rev\_hlpful\_cnt": 227, "goods\_rev\_starscr\_avg\_val": 2.97, "wish\_list\_cnt": 68, "lang\_cd": "ko", "goods\_nm": "묶음상품 테스트", "adve\_wrd": null, "prest\_nm": null, "brand\_nm": "플래티어", "sch\_kwd\_nm": null, "brand\_img\_path\_nm": "<https://img-stg.x2bee.com/attachment/goods/2023/06/24/bcf95ed7-bc6c-41cd-a7a2-4f20a789c6d0\\_10.png>", "brand\_img\_file\_nm": "2023-06-24 19 50 01.png", "goods\_rep\_img\_path\_nm": "<https://img-stg.x2bee.com/attachment/goods/2023/06/24/4fee8d7b-ee21-4c94-97ef-b2a14e543528\\_10.jpg>", "goods\_dtl\_desc": "

테스트테스트111

", "goods\_nm\_analy": "묶음 상품 테스트 ", "adve\_wrd\_analy": "", "prest\_nm\_analy": "", "brand\_nm\_analy": "플 래 티 어 ", "sch\_kwd\_nm\_analy": "", "goods\_dtl\_desc\_analy": "< p > 테스트 테스트 111 \</ p > " }, { "goods\_no": "10001861", "entr\_no": "1000002", "goods\_comp\_cd": "10", "goods\_typ\_cd": "10", "sale\_meth\_cd": "10", "brand\_no": "100002", "buyr\_age\_lmt\_cd": "15", "disp\_yn": "Y", "sale\_stat\_cd": "10", "goods\_reg\_dtm": "2023-06-19T21:01:45.888172", "sale\_str\_dtm": "2023-06-19T00:00:00", "sale\_end\_dtm": "2999-12-31T23:59:59", "stk\_mgr\_yn": "Y", "deli\_proc\_typ\_cd": "20", "deli\_goods\_gb\_cd": "01", "deli\_way\_cd": "01", "deli\_dday": 1, "deli\_polc\_no": "10000020", "prc\_hist\_str\_dtm": "2023-06-19T21:01:46.120262", "prc\_hist\_end\_dtm": "2999-12-31T23:59:59", "rcnt\_sale\_prc": 25000, "sale\_prc": 21000, "aply\_prc": 20370, "dc\_rate": 18, "disp\_ctg\_no": "212", "dlex\_typ\_cd": "10", "goods\_immed\_dc\_cpn\_no": "10001861", "goods\_immed\_dc\_aply\_str\_dtm": "2023-06-24T10:12:00", "goods\_immed\_dc\_aply\_end\_dtm": "2023-07-23T23:59:59", "goods\_rep\_img\_cont\_sn": "", "rserv\_sale\_yn": "N", "rserv\_str\_dtm": null, "rserv\_end\_dtm": null, "goods\_rev\_cnt": 19, "goods\_rev\_hlpful\_cnt": 228, "goods\_rev\_starscr\_avg\_val": 3.23, "wish\_list\_cnt": 63, "lang\_cd": "ko", "goods\_nm": "상품복사이미지테스트05", "adve\_wrd": null, "prest\_nm": null, "brand\_nm": "멀버리", "sch\_kwd\_nm": "123,3445", "brand\_img\_path\_nm": "<https://img-stg.x2bee.com/attachment/goods/2023/06/24/513c45e1-1de5-492e-85cb-a62766fae2dc\\_10.png>", "brand\_img\_file\_nm": "2023-06-24 19 46 37.png", "goods\_rep\_img\_path\_nm": "<https://img-stg.x2bee.com/attachment/goods/2023/06/19/abe9aacc-d2e6-4af9-9201-edb79b4743fb\\_10.jpg>", "goods\_dtl\_desc": "

l;'l;'l'kl;'kl;

", "goods\_nm\_analy": "상품 복사 이미지 테스트 05 ", "adve\_wrd\_analy": "", "prest\_nm\_analy": "", "brand\_nm\_analy": "멀 버리 ", "sch\_kwd\_nm\_analy": "123 , 3445 ", "goods\_dtl\_desc\_analy": "< p > l ;' l ;' l ' kl ;' kl ;\</ p > " }" %}

```
    ]
}
```
