Advertisement
Guest User

Untitled

a guest
Jul 21st, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 53.13 KB | None | 0 0
  1. ```
  2. # NO STORE_CTR QUERY
  3. GET consumer_search_index_v6/_search
  4. {
  5. "profile": true,
  6. "query": {
  7. "bool": {
  8. "adjust_pure_negative": true,
  9. "minimum_should_match": "1",
  10. "must": [
  11. {
  12. "dis_max": {
  13. "tie_breaker": 0.3,
  14. "boost": 1.0,
  15. "queries": [
  16. {
  17. "multi_match": {
  18. "slop": 0,
  19. "fields": [
  20. "business_tags^1.0"
  21. ],
  22. "fuzzy_transpositions": true,
  23. "auto_generate_synonyms_phrase_query": true,
  24. "operator": "OR",
  25. "type": "best_fields",
  26. "query": "pizza",
  27. "prefix_length": 0,
  28. "zero_terms_query": "NONE",
  29. "minimum_should_match": "50%",
  30. "max_expansions": 50,
  31. "boost": 1.5
  32. }
  33. },
  34. {
  35. "multi_match": {
  36. "slop": 0,
  37. "fields": [
  38. "item_name^1.0"
  39. ],
  40. "fuzzy_transpositions": true,
  41. "auto_generate_synonyms_phrase_query": true,
  42. "operator": "OR",
  43. "type": "best_fields",
  44. "query": "pizza",
  45. "prefix_length": 0,
  46. "zero_terms_query": "NONE",
  47. "minimum_should_match": "50%",
  48. "max_expansions": 50,
  49. "boost": 1.5
  50. }
  51. },
  52. {
  53. "multi_match": {
  54. "slop": 0,
  55. "fields": [
  56. "store_categories^1.0"
  57. ],
  58. "fuzzy_transpositions": true,
  59. "auto_generate_synonyms_phrase_query": true,
  60. "operator": "OR",
  61. "type": "best_fields",
  62. "query": "pizza",
  63. "prefix_length": 0,
  64. "zero_terms_query": "NONE",
  65. "minimum_should_match": "50%",
  66. "max_expansions": 50,
  67. "boost": 1.5
  68. }
  69. },
  70. {
  71. "multi_match": {
  72. "slop": 10,
  73. "fields": [
  74. "store_name_ngram^1.0"
  75. ],
  76. "fuzzy_transpositions": true,
  77. "auto_generate_synonyms_phrase_query": true,
  78. "operator": "OR",
  79. "type": "best_fields",
  80. "query": "pizza",
  81. "prefix_length": 0,
  82. "zero_terms_query": "NONE",
  83. "minimum_should_match": "25%",
  84. "max_expansions": 50,
  85. "boost": 0.8
  86. }
  87. },
  88. {
  89. "multi_match": {
  90. "slop": 0,
  91. "fields": [
  92. "store_name_phonetic^1.0"
  93. ],
  94. "fuzzy_transpositions": true,
  95. "auto_generate_synonyms_phrase_query": true,
  96. "operator": "OR",
  97. "type": "best_fields",
  98. "query": "pizza",
  99. "prefix_length": 0,
  100. "zero_terms_query": "NONE",
  101. "minimum_should_match": "25%",
  102. "max_expansions": 50,
  103. "boost": 1.0
  104. }
  105. },
  106. {
  107. "multi_match": {
  108. "slop": 0,
  109. "fields": [
  110. "store_name_standard^1.0"
  111. ],
  112. "fuzzy_transpositions": true,
  113. "auto_generate_synonyms_phrase_query": true,
  114. "operator": "OR",
  115. "type": "best_fields",
  116. "query": "pizza",
  117. "prefix_length": 0,
  118. "zero_terms_query": "NONE",
  119. "minimum_should_match": "50%",
  120. "max_expansions": 50,
  121. "boost": 3.0
  122. }
  123. }
  124. ]
  125. }
  126. }
  127. ],
  128. "boost": 1.0,
  129. "should": [
  130. {
  131. "bool": {
  132. "filter": [
  133. {
  134. "term": {
  135. "item_is_active": {
  136. "boost": 1.0,
  137. "value": true
  138. }
  139. }
  140. }
  141. ],
  142. "adjust_pure_negative": true,
  143. "boost": 1.0,
  144. "must": [
  145. {
  146. "has_parent": {
  147. "query": {
  148. "bool": {
  149. "filter": [
  150. {
  151. "bool": {
  152. "adjust_pure_negative": true,
  153. "must": [
  154. {
  155. "bool": {
  156. "adjust_pure_negative": true,
  157. "minimum_should_match": "2",
  158. "boost": 1.0,
  159. "should": [
  160. {
  161. "bool": {
  162. "adjust_pure_negative": true,
  163. "boost": 1.0,
  164. "must_not": [
  165. {
  166. "exists": {
  167. "field": "store_max_delivery_radius_circle",
  168. "boost": 1.0
  169. }
  170. }
  171. ]
  172. }
  173. },
  174. {
  175. "geo_shape": {
  176. "store_max_delivery_radius_circle": {
  177. "shape": {
  178. "type": "multipoint",
  179. "coordinates": [
  180. [
  181. -122.4084229,
  182. 37.7837394
  183. ]
  184. ]
  185. },
  186. "relation": "intersects"
  187. },
  188. "boost": 1.0,
  189. "ignore_unmapped": false
  190. }
  191. },
  192. {
  193. "bool": {
  194. "adjust_pure_negative": true,
  195. "boost": 1.0,
  196. "must_not": [
  197. {
  198. "exists": {
  199. "field": "store_max_delivery_polygon",
  200. "boost": 1.0
  201. }
  202. }
  203. ]
  204. }
  205. },
  206. {
  207. "geo_shape": {
  208. "boost": 1.0,
  209. "store_max_delivery_polygon": {
  210. "shape": {
  211. "type": "multipoint",
  212. "coordinates": [
  213. [
  214. -122.4084229,
  215. 37.7837394
  216. ]
  217. ]
  218. },
  219. "relation": "intersects"
  220. },
  221. "ignore_unmapped": false
  222. }
  223. }
  224. ]
  225. }
  226. },
  227. {
  228. "term": {
  229. "store_is_active": {
  230. "boost": 1.0,
  231. "value": true
  232. }
  233. }
  234. },
  235. {
  236. "terms": {
  237. "boost": 1.0,
  238. "store_starting_point": [
  239. 9,
  240. 70,
  241. 82,
  242. 96,
  243. 453,
  244. 5062
  245. ]
  246. }
  247. }
  248. ],
  249. "boost": 1.0,
  250. "must_not": [
  251. {
  252. "term": {
  253. "store_is_test": {
  254. "boost": 1.0,
  255. "value": true
  256. }
  257. }
  258. }
  259. ],
  260. "should": [
  261. {
  262. "geo_shape": {
  263. "boost": 1.0,
  264. "store_delivery_radius_circle": {
  265. "shape": {
  266. "type": "multipoint",
  267. "coordinates": [
  268. [
  269. -122.4084229,
  270. 37.7837394
  271. ]
  272. ]
  273. },
  274. "relation": "intersects"
  275. },
  276. "ignore_unmapped": false
  277. }
  278. },
  279. {
  280. "geo_distance": {
  281. "distance": 4400.0,
  282. "ignore_unmapped": false,
  283. "distance_type": "arc",
  284. "store_location": [
  285. -122.4084229,
  286. 37.7837394
  287. ],
  288. "validation_method": "STRICT",
  289. "boost": 1.0
  290. }
  291. }
  292. ]
  293. }
  294. }
  295. ],
  296. "adjust_pure_negative": true,
  297. "boost": 1.0
  298. }
  299. },
  300. "score": true,
  301. "boost": 1.0,
  302. "ignore_unmapped": false,
  303. "parent_type": "store"
  304. }
  305. }
  306. ]
  307. }
  308. },
  309. {
  310. "bool": {
  311. "filter": [
  312. {
  313. "bool": {
  314. "adjust_pure_negative": true,
  315. "must": [
  316. {
  317. "bool": {
  318. "adjust_pure_negative": true,
  319. "minimum_should_match": "2",
  320. "boost": 1.0,
  321. "should": [
  322. {
  323. "bool": {
  324. "adjust_pure_negative": true,
  325. "boost": 1.0,
  326. "must_not": [
  327. {
  328. "exists": {
  329. "field": "store_max_delivery_radius_circle",
  330. "boost": 1.0
  331. }
  332. }
  333. ]
  334. }
  335. },
  336. {
  337. "geo_shape": {
  338. "store_max_delivery_radius_circle": {
  339. "shape": {
  340. "type": "multipoint",
  341. "coordinates": [
  342. [
  343. -122.4084229,
  344. 37.7837394
  345. ]
  346. ]
  347. },
  348. "relation": "intersects"
  349. },
  350. "boost": 1.0,
  351. "ignore_unmapped": false
  352. }
  353. },
  354. {
  355. "bool": {
  356. "adjust_pure_negative": true,
  357. "boost": 1.0,
  358. "must_not": [
  359. {
  360. "exists": {
  361. "field": "store_max_delivery_polygon",
  362. "boost": 1.0
  363. }
  364. }
  365. ]
  366. }
  367. },
  368. {
  369. "geo_shape": {
  370. "boost": 1.0,
  371. "store_max_delivery_polygon": {
  372. "shape": {
  373. "type": "multipoint",
  374. "coordinates": [
  375. [
  376. -122.4084229,
  377. 37.7837394
  378. ]
  379. ]
  380. },
  381. "relation": "intersects"
  382. },
  383. "ignore_unmapped": false
  384. }
  385. }
  386. ]
  387. }
  388. },
  389. {
  390. "term": {
  391. "store_is_active": {
  392. "boost": 1.0,
  393. "value": true
  394. }
  395. }
  396. },
  397. {
  398. "terms": {
  399. "boost": 1.0,
  400. "store_starting_point": [
  401. 9,
  402. 70,
  403. 82,
  404. 96,
  405. 453,
  406. 5062
  407. ]
  408. }
  409. }
  410. ],
  411. "boost": 1.0,
  412. "must_not": [
  413. {
  414. "term": {
  415. "store_is_test": {
  416. "boost": 1.0,
  417. "value": true
  418. }
  419. }
  420. }
  421. ],
  422. "should": [
  423. {
  424. "geo_shape": {
  425. "boost": 1.0,
  426. "store_delivery_radius_circle": {
  427. "shape": {
  428. "type": "multipoint",
  429. "coordinates": [
  430. [
  431. -122.4084229,
  432. 37.7837394
  433. ]
  434. ]
  435. },
  436. "relation": "intersects"
  437. },
  438. "ignore_unmapped": false
  439. }
  440. },
  441. {
  442. "geo_distance": {
  443. "distance": 4400.0,
  444. "ignore_unmapped": false,
  445. "distance_type": "arc",
  446. "store_location": [
  447. -122.4084229,
  448. 37.7837394
  449. ],
  450. "validation_method": "STRICT",
  451. "boost": 1.0
  452. }
  453. }
  454. ]
  455. }
  456. }
  457. ],
  458. "adjust_pure_negative": true,
  459. "boost": 1.0
  460. }
  461. }
  462. ]
  463. }
  464. },
  465. "min_score": 2.0,
  466. "from": 0,
  467. "size": 650
  468. }
  469.  
  470. # OLD QUERY
  471. GET consumer_search_index_v6/_search
  472. {
  473. "profile": true,
  474. "query": {
  475. "bool": {
  476. "adjust_pure_negative": true,
  477. "minimum_should_match": "1",
  478. "must": [
  479. {
  480. "dis_max": {
  481. "tie_breaker": 0.3,
  482. "boost": 1.0,
  483. "queries": [
  484. {
  485. "multi_match": {
  486. "slop": 0,
  487. "fields": [
  488. "business_tags^1.0"
  489. ],
  490. "fuzzy_transpositions": true,
  491. "auto_generate_synonyms_phrase_query": true,
  492. "operator": "OR",
  493. "type": "best_fields",
  494. "query": "pizza",
  495. "prefix_length": 0,
  496. "zero_terms_query": "NONE",
  497. "minimum_should_match": "50%",
  498. "max_expansions": 50,
  499. "boost": 1.5
  500. }
  501. },
  502. {
  503. "multi_match": {
  504. "slop": 0,
  505. "fields": [
  506. "item_name^1.0"
  507. ],
  508. "fuzzy_transpositions": true,
  509. "auto_generate_synonyms_phrase_query": true,
  510. "operator": "OR",
  511. "type": "best_fields",
  512. "query": "pizza",
  513. "prefix_length": 0,
  514. "zero_terms_query": "NONE",
  515. "minimum_should_match": "50%",
  516. "max_expansions": 50,
  517. "boost": 1.5
  518. }
  519. },
  520. {
  521. "multi_match": {
  522. "slop": 0,
  523. "fields": [
  524. "store_categories^1.0"
  525. ],
  526. "fuzzy_transpositions": true,
  527. "auto_generate_synonyms_phrase_query": true,
  528. "operator": "OR",
  529. "type": "best_fields",
  530. "query": "pizza",
  531. "prefix_length": 0,
  532. "zero_terms_query": "NONE",
  533. "minimum_should_match": "50%",
  534. "max_expansions": 50,
  535. "boost": 1.5
  536. }
  537. },
  538. {
  539. "multi_match": {
  540. "slop": 10,
  541. "fields": [
  542. "store_name_ngram^1.0"
  543. ],
  544. "fuzzy_transpositions": true,
  545. "auto_generate_synonyms_phrase_query": true,
  546. "operator": "OR",
  547. "type": "best_fields",
  548. "query": "pizza",
  549. "prefix_length": 0,
  550. "zero_terms_query": "NONE",
  551. "minimum_should_match": "25%",
  552. "max_expansions": 50,
  553. "boost": 0.8
  554. }
  555. },
  556. {
  557. "multi_match": {
  558. "slop": 0,
  559. "fields": [
  560. "store_name_phonetic^1.0"
  561. ],
  562. "fuzzy_transpositions": true,
  563. "auto_generate_synonyms_phrase_query": true,
  564. "operator": "OR",
  565. "type": "best_fields",
  566. "query": "pizza",
  567. "prefix_length": 0,
  568. "zero_terms_query": "NONE",
  569. "minimum_should_match": "25%",
  570. "max_expansions": 50,
  571. "boost": 1.0
  572. }
  573. },
  574. {
  575. "multi_match": {
  576. "slop": 0,
  577. "fields": [
  578. "store_name_standard^1.0"
  579. ],
  580. "fuzzy_transpositions": true,
  581. "auto_generate_synonyms_phrase_query": true,
  582. "operator": "OR",
  583. "type": "best_fields",
  584. "query": "pizza",
  585. "prefix_length": 0,
  586. "zero_terms_query": "NONE",
  587. "minimum_should_match": "50%",
  588. "max_expansions": 50,
  589. "boost": 3.0
  590. }
  591. },
  592. {
  593. "function_score": {
  594. "query": {
  595. "match_all": {
  596. "boost": 1.0
  597. }
  598. },
  599. "functions": [
  600. {
  601. "filter": {
  602. "match_all": {
  603. "boost": 1.0
  604. }
  605. },
  606. "field_value_factor": {
  607. "field": "store_ctr",
  608. "modifier": "none",
  609. "factor": 20.0,
  610. "missing": 0.0
  611. }
  612. }
  613. ],
  614. "max_boost": 3.4028235e+38,
  615. "boost": 1.0,
  616. "score_mode": "multiply"
  617. }
  618. }
  619. ]
  620. }
  621. }
  622. ],
  623. "boost": 1.0,
  624. "should": [
  625. {
  626. "bool": {
  627. "filter": [
  628. {
  629. "term": {
  630. "item_is_active": {
  631. "boost": 1.0,
  632. "value": true
  633. }
  634. }
  635. }
  636. ],
  637. "adjust_pure_negative": true,
  638. "boost": 1.0,
  639. "must": [
  640. {
  641. "has_parent": {
  642. "query": {
  643. "bool": {
  644. "filter": [
  645. {
  646. "bool": {
  647. "adjust_pure_negative": true,
  648. "must": [
  649. {
  650. "bool": {
  651. "adjust_pure_negative": true,
  652. "minimum_should_match": "2",
  653. "boost": 1.0,
  654. "should": [
  655. {
  656. "bool": {
  657. "adjust_pure_negative": true,
  658. "boost": 1.0,
  659. "must_not": [
  660. {
  661. "exists": {
  662. "field": "store_max_delivery_radius_circle",
  663. "boost": 1.0
  664. }
  665. }
  666. ]
  667. }
  668. },
  669. {
  670. "geo_shape": {
  671. "store_max_delivery_radius_circle": {
  672. "shape": {
  673. "type": "multipoint",
  674. "coordinates": [
  675. [
  676. -122.4084229,
  677. 37.7837394
  678. ]
  679. ]
  680. },
  681. "relation": "intersects"
  682. },
  683. "boost": 1.0,
  684. "ignore_unmapped": false
  685. }
  686. },
  687. {
  688. "bool": {
  689. "adjust_pure_negative": true,
  690. "boost": 1.0,
  691. "must_not": [
  692. {
  693. "exists": {
  694. "field": "store_max_delivery_polygon",
  695. "boost": 1.0
  696. }
  697. }
  698. ]
  699. }
  700. },
  701. {
  702. "geo_shape": {
  703. "boost": 1.0,
  704. "store_max_delivery_polygon": {
  705. "shape": {
  706. "type": "multipoint",
  707. "coordinates": [
  708. [
  709. -122.4084229,
  710. 37.7837394
  711. ]
  712. ]
  713. },
  714. "relation": "intersects"
  715. },
  716. "ignore_unmapped": false
  717. }
  718. }
  719. ]
  720. }
  721. },
  722. {
  723. "term": {
  724. "store_is_active": {
  725. "boost": 1.0,
  726. "value": true
  727. }
  728. }
  729. },
  730. {
  731. "terms": {
  732. "boost": 1.0,
  733. "store_starting_point": [
  734. 9,
  735. 70,
  736. 82,
  737. 96,
  738. 453,
  739. 5062
  740. ]
  741. }
  742. }
  743. ],
  744. "boost": 1.0,
  745. "must_not": [
  746. {
  747. "term": {
  748. "store_is_test": {
  749. "boost": 1.0,
  750. "value": true
  751. }
  752. }
  753. }
  754. ],
  755. "should": [
  756. {
  757. "geo_shape": {
  758. "boost": 1.0,
  759. "store_delivery_radius_circle": {
  760. "shape": {
  761. "type": "multipoint",
  762. "coordinates": [
  763. [
  764. -122.4084229,
  765. 37.7837394
  766. ]
  767. ]
  768. },
  769. "relation": "intersects"
  770. },
  771. "ignore_unmapped": false
  772. }
  773. },
  774. {
  775. "geo_distance": {
  776. "distance": 4400.0,
  777. "ignore_unmapped": false,
  778. "distance_type": "arc",
  779. "store_location": [
  780. -122.4084229,
  781. 37.7837394
  782. ],
  783. "validation_method": "STRICT",
  784. "boost": 1.0
  785. }
  786. }
  787. ]
  788. }
  789. }
  790. ],
  791. "adjust_pure_negative": true,
  792. "boost": 1.0
  793. }
  794. },
  795. "score": true,
  796. "boost": 1.0,
  797. "ignore_unmapped": false,
  798. "parent_type": "store"
  799. }
  800. }
  801. ]
  802. }
  803. },
  804. {
  805. "bool": {
  806. "filter": [
  807. {
  808. "bool": {
  809. "adjust_pure_negative": true,
  810. "must": [
  811. {
  812. "bool": {
  813. "adjust_pure_negative": true,
  814. "minimum_should_match": "2",
  815. "boost": 1.0,
  816. "should": [
  817. {
  818. "bool": {
  819. "adjust_pure_negative": true,
  820. "boost": 1.0,
  821. "must_not": [
  822. {
  823. "exists": {
  824. "field": "store_max_delivery_radius_circle",
  825. "boost": 1.0
  826. }
  827. }
  828. ]
  829. }
  830. },
  831. {
  832. "geo_shape": {
  833. "store_max_delivery_radius_circle": {
  834. "shape": {
  835. "type": "multipoint",
  836. "coordinates": [
  837. [
  838. -122.4084229,
  839. 37.7837394
  840. ]
  841. ]
  842. },
  843. "relation": "intersects"
  844. },
  845. "boost": 1.0,
  846. "ignore_unmapped": false
  847. }
  848. },
  849. {
  850. "bool": {
  851. "adjust_pure_negative": true,
  852. "boost": 1.0,
  853. "must_not": [
  854. {
  855. "exists": {
  856. "field": "store_max_delivery_polygon",
  857. "boost": 1.0
  858. }
  859. }
  860. ]
  861. }
  862. },
  863. {
  864. "geo_shape": {
  865. "boost": 1.0,
  866. "store_max_delivery_polygon": {
  867. "shape": {
  868. "type": "multipoint",
  869. "coordinates": [
  870. [
  871. -122.4084229,
  872. 37.7837394
  873. ]
  874. ]
  875. },
  876. "relation": "intersects"
  877. },
  878. "ignore_unmapped": false
  879. }
  880. }
  881. ]
  882. }
  883. },
  884. {
  885. "term": {
  886. "store_is_active": {
  887. "boost": 1.0,
  888. "value": true
  889. }
  890. }
  891. },
  892. {
  893. "terms": {
  894. "boost": 1.0,
  895. "store_starting_point": [
  896. 9,
  897. 70,
  898. 82,
  899. 96,
  900. 453,
  901. 5062
  902. ]
  903. }
  904. }
  905. ],
  906. "boost": 1.0,
  907. "must_not": [
  908. {
  909. "term": {
  910. "store_is_test": {
  911. "boost": 1.0,
  912. "value": true
  913. }
  914. }
  915. }
  916. ],
  917. "should": [
  918. {
  919. "geo_shape": {
  920. "boost": 1.0,
  921. "store_delivery_radius_circle": {
  922. "shape": {
  923. "type": "multipoint",
  924. "coordinates": [
  925. [
  926. -122.4084229,
  927. 37.7837394
  928. ]
  929. ]
  930. },
  931. "relation": "intersects"
  932. },
  933. "ignore_unmapped": false
  934. }
  935. },
  936. {
  937. "geo_distance": {
  938. "distance": 4400.0,
  939. "ignore_unmapped": false,
  940. "distance_type": "arc",
  941. "store_location": [
  942. -122.4084229,
  943. 37.7837394
  944. ],
  945. "validation_method": "STRICT",
  946. "boost": 1.0
  947. }
  948. }
  949. ]
  950. }
  951. }
  952. ],
  953. "adjust_pure_negative": true,
  954. "boost": 1.0
  955. }
  956. }
  957. ]
  958. }
  959. },
  960. "min_score": 2.0,
  961. "from": 0,
  962. "size": 650
  963. }
  964.  
  965. # NEW QUERY
  966. GET consumer_search_index_v6/_search
  967. {
  968. "profile": true,
  969. "query": {
  970. "bool": {
  971. "adjust_pure_negative": true,
  972. "minimum_should_match": "1",
  973. "must": [
  974. {
  975. "dis_max": {
  976. "tie_breaker": 0.3,
  977. "boost": 1.0,
  978. "queries": [
  979. {
  980. "multi_match": {
  981. "slop": 0,
  982. "fields": [
  983. "business_tags^1.0"
  984. ],
  985. "fuzzy_transpositions": true,
  986. "auto_generate_synonyms_phrase_query": true,
  987. "operator": "OR",
  988. "type": "best_fields",
  989. "query": "pizza",
  990. "prefix_length": 0,
  991. "zero_terms_query": "NONE",
  992. "minimum_should_match": "50%",
  993. "max_expansions": 50,
  994. "boost": 1.5
  995. }
  996. },
  997. {
  998. "multi_match": {
  999. "slop": 0,
  1000. "fields": [
  1001. "item_name^1.0"
  1002. ],
  1003. "fuzzy_transpositions": true,
  1004. "auto_generate_synonyms_phrase_query": true,
  1005. "operator": "OR",
  1006. "type": "best_fields",
  1007. "query": "pizza",
  1008. "prefix_length": 0,
  1009. "zero_terms_query": "NONE",
  1010. "minimum_should_match": "50%",
  1011. "max_expansions": 50,
  1012. "boost": 1.5
  1013. }
  1014. },
  1015. {
  1016. "multi_match": {
  1017. "slop": 0,
  1018. "fields": [
  1019. "store_categories^1.0"
  1020. ],
  1021. "fuzzy_transpositions": true,
  1022. "auto_generate_synonyms_phrase_query": true,
  1023. "operator": "OR",
  1024. "type": "best_fields",
  1025. "query": "pizza",
  1026. "prefix_length": 0,
  1027. "zero_terms_query": "NONE",
  1028. "minimum_should_match": "50%",
  1029. "max_expansions": 50,
  1030. "boost": 1.5
  1031. }
  1032. },
  1033. {
  1034. "multi_match": {
  1035. "slop": 10,
  1036. "fields": [
  1037. "store_name_ngram^1.0"
  1038. ],
  1039. "fuzzy_transpositions": true,
  1040. "auto_generate_synonyms_phrase_query": true,
  1041. "operator": "OR",
  1042. "type": "best_fields",
  1043. "query": "pizza",
  1044. "prefix_length": 0,
  1045. "zero_terms_query": "NONE",
  1046. "minimum_should_match": "25%",
  1047. "max_expansions": 50,
  1048. "boost": 0.8
  1049. }
  1050. },
  1051. {
  1052. "multi_match": {
  1053. "slop": 0,
  1054. "fields": [
  1055. "store_name_phonetic^1.0"
  1056. ],
  1057. "fuzzy_transpositions": true,
  1058. "auto_generate_synonyms_phrase_query": true,
  1059. "operator": "OR",
  1060. "type": "best_fields",
  1061. "query": "pizza",
  1062. "prefix_length": 0,
  1063. "zero_terms_query": "NONE",
  1064. "minimum_should_match": "25%",
  1065. "max_expansions": 50,
  1066. "boost": 1.0
  1067. }
  1068. },
  1069. {
  1070. "multi_match": {
  1071. "slop": 0,
  1072. "fields": [
  1073. "store_name_standard^1.0"
  1074. ],
  1075. "fuzzy_transpositions": true,
  1076. "auto_generate_synonyms_phrase_query": true,
  1077. "operator": "OR",
  1078. "type": "best_fields",
  1079. "query": "pizza",
  1080. "prefix_length": 0,
  1081. "zero_terms_query": "NONE",
  1082. "minimum_should_match": "50%",
  1083. "max_expansions": 50,
  1084. "boost": 3.0
  1085. }
  1086. },
  1087. {
  1088. "function_score": {
  1089. "query": {
  1090. "exists": {
  1091. "field": "store_id",
  1092. "boost": 1.0
  1093. }
  1094. },
  1095. "functions": [
  1096. {
  1097. "filter": {
  1098. "match_all": {
  1099. "boost": 1.0
  1100. }
  1101. },
  1102. "field_value_factor": {
  1103. "field": "store_ctr",
  1104. "modifier": "none",
  1105. "factor": 20.0,
  1106. "missing": 0.0
  1107. }
  1108. }
  1109. ],
  1110. "max_boost": 3.4028235e+38,
  1111. "boost": 1.0,
  1112. "score_mode": "multiply"
  1113. }
  1114. }
  1115. ]
  1116. }
  1117. }
  1118. ],
  1119. "boost": 1.0,
  1120. "should": [
  1121. {
  1122. "bool": {
  1123. "filter": [
  1124. {
  1125. "term": {
  1126. "item_is_active": {
  1127. "boost": 1.0,
  1128. "value": true
  1129. }
  1130. }
  1131. }
  1132. ],
  1133. "adjust_pure_negative": true,
  1134. "boost": 1.0,
  1135. "must": [
  1136. {
  1137. "has_parent": {
  1138. "query": {
  1139. "bool": {
  1140. "filter": [
  1141. {
  1142. "bool": {
  1143. "adjust_pure_negative": true,
  1144. "must": [
  1145. {
  1146. "bool": {
  1147. "adjust_pure_negative": true,
  1148. "minimum_should_match": "2",
  1149. "boost": 1.0,
  1150. "should": [
  1151. {
  1152. "bool": {
  1153. "adjust_pure_negative": true,
  1154. "boost": 1.0,
  1155. "must_not": [
  1156. {
  1157. "exists": {
  1158. "field": "store_max_delivery_radius_circle",
  1159. "boost": 1.0
  1160. }
  1161. }
  1162. ]
  1163. }
  1164. },
  1165. {
  1166. "geo_shape": {
  1167. "store_max_delivery_radius_circle": {
  1168. "shape": {
  1169. "type": "multipoint",
  1170. "coordinates": [
  1171. [
  1172. -122.4084229,
  1173. 37.7837394
  1174. ]
  1175. ]
  1176. },
  1177. "relation": "intersects"
  1178. },
  1179. "boost": 1.0,
  1180. "ignore_unmapped": false
  1181. }
  1182. },
  1183. {
  1184. "bool": {
  1185. "adjust_pure_negative": true,
  1186. "boost": 1.0,
  1187. "must_not": [
  1188. {
  1189. "exists": {
  1190. "field": "store_max_delivery_polygon",
  1191. "boost": 1.0
  1192. }
  1193. }
  1194. ]
  1195. }
  1196. },
  1197. {
  1198. "geo_shape": {
  1199. "boost": 1.0,
  1200. "store_max_delivery_polygon": {
  1201. "shape": {
  1202. "type": "multipoint",
  1203. "coordinates": [
  1204. [
  1205. -122.4084229,
  1206. 37.7837394
  1207. ]
  1208. ]
  1209. },
  1210. "relation": "intersects"
  1211. },
  1212. "ignore_unmapped": false
  1213. }
  1214. }
  1215. ]
  1216. }
  1217. },
  1218. {
  1219. "term": {
  1220. "store_is_active": {
  1221. "boost": 1.0,
  1222. "value": true
  1223. }
  1224. }
  1225. },
  1226. {
  1227. "terms": {
  1228. "boost": 1.0,
  1229. "store_starting_point": [
  1230. 9,
  1231. 70,
  1232. 82,
  1233. 96,
  1234. 453,
  1235. 5062
  1236. ]
  1237. }
  1238. }
  1239. ],
  1240. "boost": 1.0,
  1241. "must_not": [
  1242. {
  1243. "term": {
  1244. "store_is_test": {
  1245. "boost": 1.0,
  1246. "value": true
  1247. }
  1248. }
  1249. }
  1250. ],
  1251. "should": [
  1252. {
  1253. "geo_shape": {
  1254. "boost": 1.0,
  1255. "store_delivery_radius_circle": {
  1256. "shape": {
  1257. "type": "multipoint",
  1258. "coordinates": [
  1259. [
  1260. -122.4084229,
  1261. 37.7837394
  1262. ]
  1263. ]
  1264. },
  1265. "relation": "intersects"
  1266. },
  1267. "ignore_unmapped": false
  1268. }
  1269. },
  1270. {
  1271. "geo_distance": {
  1272. "distance": 4400.0,
  1273. "ignore_unmapped": false,
  1274. "distance_type": "arc",
  1275. "store_location": [
  1276. -122.4084229,
  1277. 37.7837394
  1278. ],
  1279. "validation_method": "STRICT",
  1280. "boost": 1.0
  1281. }
  1282. }
  1283. ]
  1284. }
  1285. }
  1286. ],
  1287. "adjust_pure_negative": true,
  1288. "boost": 1.0
  1289. }
  1290. },
  1291. "score": true,
  1292. "boost": 1.0,
  1293. "ignore_unmapped": false,
  1294. "parent_type": "store"
  1295. }
  1296. }
  1297. ]
  1298. }
  1299. },
  1300. {
  1301. "bool": {
  1302. "filter": [
  1303. {
  1304. "bool": {
  1305. "adjust_pure_negative": true,
  1306. "must": [
  1307. {
  1308. "bool": {
  1309. "adjust_pure_negative": true,
  1310. "minimum_should_match": "2",
  1311. "boost": 1.0,
  1312. "should": [
  1313. {
  1314. "bool": {
  1315. "adjust_pure_negative": true,
  1316. "boost": 1.0,
  1317. "must_not": [
  1318. {
  1319. "exists": {
  1320. "field": "store_max_delivery_radius_circle",
  1321. "boost": 1.0
  1322. }
  1323. }
  1324. ]
  1325. }
  1326. },
  1327. {
  1328. "geo_shape": {
  1329. "store_max_delivery_radius_circle": {
  1330. "shape": {
  1331. "type": "multipoint",
  1332. "coordinates": [
  1333. [
  1334. -122.4084229,
  1335. 37.7837394
  1336. ]
  1337. ]
  1338. },
  1339. "relation": "intersects"
  1340. },
  1341. "boost": 1.0,
  1342. "ignore_unmapped": false
  1343. }
  1344. },
  1345. {
  1346. "bool": {
  1347. "adjust_pure_negative": true,
  1348. "boost": 1.0,
  1349. "must_not": [
  1350. {
  1351. "exists": {
  1352. "field": "store_max_delivery_polygon",
  1353. "boost": 1.0
  1354. }
  1355. }
  1356. ]
  1357. }
  1358. },
  1359. {
  1360. "geo_shape": {
  1361. "boost": 1.0,
  1362. "store_max_delivery_polygon": {
  1363. "shape": {
  1364. "type": "multipoint",
  1365. "coordinates": [
  1366. [
  1367. -122.4084229,
  1368. 37.7837394
  1369. ]
  1370. ]
  1371. },
  1372. "relation": "intersects"
  1373. },
  1374. "ignore_unmapped": false
  1375. }
  1376. }
  1377. ]
  1378. }
  1379. },
  1380. {
  1381. "term": {
  1382. "store_is_active": {
  1383. "boost": 1.0,
  1384. "value": true
  1385. }
  1386. }
  1387. },
  1388. {
  1389. "terms": {
  1390. "boost": 1.0,
  1391. "store_starting_point": [
  1392. 9,
  1393. 70,
  1394. 82,
  1395. 96,
  1396. 453,
  1397. 5062
  1398. ]
  1399. }
  1400. }
  1401. ],
  1402. "boost": 1.0,
  1403. "must_not": [
  1404. {
  1405. "term": {
  1406. "store_is_test": {
  1407. "boost": 1.0,
  1408. "value": true
  1409. }
  1410. }
  1411. }
  1412. ],
  1413. "should": [
  1414. {
  1415. "geo_shape": {
  1416. "boost": 1.0,
  1417. "store_delivery_radius_circle": {
  1418. "shape": {
  1419. "type": "multipoint",
  1420. "coordinates": [
  1421. [
  1422. -122.4084229,
  1423. 37.7837394
  1424. ]
  1425. ]
  1426. },
  1427. "relation": "intersects"
  1428. },
  1429. "ignore_unmapped": false
  1430. }
  1431. },
  1432. {
  1433. "geo_distance": {
  1434. "distance": 4400.0,
  1435. "ignore_unmapped": false,
  1436. "distance_type": "arc",
  1437. "store_location": [
  1438. -122.4084229,
  1439. 37.7837394
  1440. ],
  1441. "validation_method": "STRICT",
  1442. "boost": 1.0
  1443. }
  1444. }
  1445. ]
  1446. }
  1447. }
  1448. ],
  1449. "adjust_pure_negative": true,
  1450. "boost": 1.0
  1451. }
  1452. }
  1453. ]
  1454. }
  1455. },
  1456. "min_score": 2.0,
  1457. "from": 0,
  1458. "size": 650
  1459. }
  1460. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement