# Query suggestion for a search engine

**URL:** <https://discuss.elastic.co/t/query-suggestion-for-a-search-engine/362706>\
**Category:** Elasticsearch\
**Created:** [July 8, 2024, 12:43pm UTC](https://discuss.elastic.co/t/query-suggestion-for-a-search-engine/362706 "2024-07-08T12:43:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jahedi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jahedi/32/135254_2.png) [@jahedi](https://discuss.elastic.co/u/jahedi)\
**Post date:** [July 8, 2024, 12:43pm UTC](https://discuss.elastic.co/t/query-suggestion-for-a-search-engine/362706/1 "2024-07-08T12:43:53Z")

</div>

Hi,  
I am currently working on a web search engine just like Google for my web site. I have crawled my website pages and indexed data in Elasticsearch. the indexed documents have such fields:

```auto
    string Id 
    string Url
    string Title
    string Body 
    string MetaKeywords
    string MetaDescription 
    List<string> H1 
    List<string> H2
    List<string> H3 
    List<string> H4 
    List<string> H5 
    List<string> H6
    int Depth // the page depth in the website: usually, if this number is less, the page is more relevant

```

I was looking for a query that gets an **array of words** as input and returns the most related pages.  
I will be very grateful if you use techniques that will improve the results like boosting, or what ever you know.  
Also, I slightly prefer the words to be "and" with each other. for example if the input was `["foo", "bar", "baz"]` the returned results should contain all these words and not just one of them (or at least the result should have most of the words). I suppose this behavior is more similar to the current search engines to prevent showing unrelated pages.  
I know this question is too general and does not have a single correct answer but I just wanted to learn options and features that I can use.

Thanks a lot.

---

<div class="post-metadata">

**Author:** ![Alex\_Salgado-Elastic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alex_salgado-elastic/32/103081_2.png) [@Alex\_Salgado-Elastic](https://discuss.elastic.co/u/Alex_Salgado-Elastic)\
**Post date:** [July 8, 2024, 1:14pm UTC](https://discuss.elastic.co/t/query-suggestion-for-a-search-engine/362706/2 "2024-07-08T13:14:43Z")

</div>

Hi @jahedi ,

Have you also considered using semantic search through vector search?

> **[Semantic search | Elasticsearch Guide \[8.14\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/semantic-search.html)**

---

<div class="post-metadata">

**Author:** ![jahedi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jahedi/32/135254_2.png) [@jahedi](https://discuss.elastic.co/u/jahedi)\
**Post date:** [July 9, 2024, 4:33am UTC](https://discuss.elastic.co/t/query-suggestion-for-a-search-engine/362706/3 "2024-07-09T04:33:22Z")

</div>

Hi @Alex_Salgado-Elastic  
Actually no! I am currently using free and basic license of the Elasticsearch

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 9, 2024, 6:20am UTC](https://discuss.elastic.co/t/query-suggestion-for-a-search-engine/362706/4 "2024-07-09T06:20:55Z")

</div>

Vector search is available with the basic tier 😊

---

<div class="post-metadata">

**Author:** ![jahedi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jahedi/32/135254_2.png) [@jahedi](https://discuss.elastic.co/u/jahedi)\
**Post date:** [July 9, 2024, 7:16am UTC](https://discuss.elastic.co/t/query-suggestion-for-a-search-engine/362706/5 "2024-07-09T07:16:39Z")

</div>

Nice! didn't know that! So I will be thankful if you use it in the answer if it helps

---

<div class="post-metadata">

**Author:** ![jahedi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jahedi/32/135254_2.png) [@jahedi](https://discuss.elastic.co/u/jahedi)\
**Post date:** [July 10, 2024, 9:10am UTC](https://discuss.elastic.co/t/query-suggestion-for-a-search-engine/362706/6 "2024-07-10T09:10:58Z")

</div>

Anyone? 🫠
