# Need some help to get started

**URL:** <https://discuss.elastic.co/t/need-some-help-to-get-started/10189>\
**Category:** Elasticsearch\
**Created:** [December 28, 2012, 10:30am UTC](https://discuss.elastic.co/t/need-some-help-to-get-started/10189 "2012-12-28T10:30:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charly\_Koza](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/charly_koza/32/2561_2.png) [@Charly\_Koza](https://discuss.elastic.co/u/Charly_Koza)\
**Post date:** [December 28, 2012, 10:30am UTC](https://discuss.elastic.co/t/need-some-help-to-get-started/10189/1 "2012-12-28T10:30:57Z")

</div>

Hi there,

I'm new to elastic search and I'm not sure how to proceed.

I have a lot of documents indexed, and I'd like to search for them using  
their name field, which are composed of many words, using some fuzziness  
to fix any misspelling. And I'd like to sort by closeness between the  
query and the name, with exact matches first, and if query exactly  
matches name it goes first (having additional words in name should not  
be before it), with some custom boosting (negative or positive) based on  
other fields of the documents.

I'd also like to search in title field if name is not specified, but I  
don't want searches with both title and name to have a higher score.

And if possible remove any result that are less than half the first  
result score.

example :

doc1: {name:'market tower toilet', title:'market tower toilet',  
amenity:'toilet'}  
doc2: {name:'market tower', tourism:'attraction'}  
doc3: {title:'tower market viewpoint'}

I want a negative boost on amenity:'toilet' and a positive one on  
tourism:'attraction'

So search market should yield : doc2/doc3/doc1

Right now I have :  
query: {  
boosting: {  
positive: {  
bool: {  
should: [  
{  
custom\_boost\_factor: {  
query: {  
match\_phrase: {  
name: search  
}  
},  
boost\_factor: 2.0  
}  
},  
{  
fuzzy\_like\_this: {  
fields: ["name"],  
like\_text: search,  
boost: 1.0  
}  
}  
]  
},  
},  
negative: {  
term: {  
amenity: 'toilet'  
}  
},  
negative\_boost: 0.2  
}  
}  
but I feel like this is not how I'm supposed to do it.

I'd like some pointer to start in the right direction.

Thanks!  
Charly

--

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:58am UTC](https://discuss.elastic.co/t/need-some-help-to-get-started/10189/2 "2017-07-06T02:58:19Z")

</div>


