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

Document Search does not return any result if only enrich option is set #223

Closed
13ogrammer opened this issue Jun 13, 2021 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@13ogrammer
Copy link

13ogrammer commented Jun 13, 2021

I am unable to get search results on Documents when only enrich: true option is set.

Here is the code I am using to test this:

var { Document } = require(`flexsearch`);

var index = new Document({
  id: "objectID",
  index: ["firstname", "lastname"],
  store: true
});

index.add({
  firstname: "Jimmie something",
  lastname: "Barninger",
  objectID: "myID1"
});
index.add({
  firstname: "Warren",
  lastname: "jimmie",
  objectID: "myID2"
});

var result = index.search("jimmie", { enrich: true });
console.log(`result`, JSON.stringify(result));
// result [] 

var resultWithIndex = index.search("jimmie", {
  index: "firstname",
  enrich: true
});
console.log(`result`, JSON.stringify(resultWithIndex));
// result [{"field":"firstname","result":[{"id":"myID1","doc":{"firstname":"Jimmie something","lastname":"Barninger","objectID":"myID1"}}]}] 

Here is the link to codesandbox: https://codesandbox.io/s/flexsearch-search-tests-2quf3

@13ogrammer 13ogrammer changed the title Document Search does not result any value if only enrich is set without pluck or index options Document Search does not return any result if only enrich option is set Jun 13, 2021
@ts-thomas ts-thomas self-assigned this Jun 14, 2021
@ts-thomas ts-thomas added the bug Something isn't working label Jun 14, 2021
ts-thomas added a commit that referenced this issue Jun 14, 2021
ts-thomas added a commit that referenced this issue Jun 14, 2021
@ts-thomas ts-thomas reopened this Jun 14, 2021
@ts-thomas
Copy link
Contributor

Thanks for the report. This bug is now fixed in 0.7.1

@13ogrammer
Copy link
Author

Thanks @ts-thomas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants