Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not an issue but a question: Does the fields of an index have to be the same as the fields from a search? #82

Open
toyssamurai opened this issue Apr 30, 2018 · 0 comments

Comments

@toyssamurai
Copy link

If I create an index using the following codes:

pouch.search({
  fields: ['title', 'text'],
  build: true
}).then(function (info) {
  // if build was successful, info is {"ok": true}
}).catch(function (err) {
  // handle error
});

then search using the following:

pouch.search({
  query: 'your query here',
  fields: ['title']
}).then(function (res) {
  // handle results
}).catch(function (err) {
  // handle error
});

See how the fields property in the search doesn't include all the fields from the pre-built index? In a case like this, will the index still be used?

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

No branches or pull requests

1 participant