Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

How to boost up fields to get priority based search #263

Open
nithin446 opened this issue Mar 1, 2018 · 0 comments
Open

How to boost up fields to get priority based search #263

nithin446 opened this issue Mar 1, 2018 · 0 comments

Comments

@nithin446
Copy link

I have the following index for searching full text.
{
"fulltext": {
"search": {
"index": "function(doc) { var ret=new Document(); ret.add(doc._id,{'field': '_id', 'boost': 2.0}); ret.add(doc.pid,{'field': 'pid', 'boost': 3.0}); ret.add(doc.artist_id,{'field': 'artist_id', 'boost': 3.0}); ret.add(doc.artist_name,{field:artist_name,'boost': 100.0}); ret.add(doc.object_title,{'field': 'object_title', 'boost': 300.0}); ret.add(doc.description ,{'field': 'description', 'boost': 80.0}); ret.add(doc.portfolio_info,{'field': 'portfolio_info'}); ret.add(doc.edition,{'field': 'edition'}); return ret }"
}
}
}

I need to get results from object_title shows first, then with artist_name, then show the remaining results.
Can you please help me where I am going wrong?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant