Searching Specific Contributor Type in Record
TLDR Greg needs to search for contributors who are authors only. Jason suggested multiple search queries filtered by types and aggregation of results on client-side.
1
Oct 03, 2022 (15 months ago)
Greg
04:59 PM{
"contributor1": {
"bio": "",
"firstName": "Lewis",
"lastName": "Carroll",
"type": "Author"
},
"contributor2": {
"bio": "",
"firstName": "Greg",
"lastName": "Mascherino",
"type": "Illustrator"
},
"contributor3": {
"bio": "",
"firstName": "Greg",
"lastName": "Jamie",
"type": "Illustrator"
},
"contributor4": {
"bio": "",
"firstName": "Jamie",
"lastName": "Greg",
"type": "Illustrator"
},
"contributor5": {
"bio": "",
"firstName": "Jamie",
"lastName": "Mascherino",
"type": "Illustrator"
}
}
I want to search for Carroll and I only want to return this result if Carroll is an author. So Searching for Greg would not be a hit.
Jason
05:44 PMfilter_by
for this. Something like contributor1.type:=Author
Jason
05:45 PMGreg
06:13 PMGreg
06:15 PMcontributors.contributor5.lastName,contributors.contributor5.firstName,contributors.contributor4.lastName,contributors.contributor1.firstName,contributors.contributor2.firstName,contributors.contributor4.firstName,contributors.contributor1.lastName,contributors.contributor2.lastName,contributors.contributor3.firstName,contributors.contributor3.lastName
Jason
06:33 PMcontributor1.type:=Author && contributor2.type:!=Author && contributor3.type:!=Author && contributor4.type:!=Author
and so onGreg
07:51 PMJason
07:54 PMQuery1:
q: carrol
filter_by: contributor1.type:=Author && contributor2.type:!=Author && contributor3.type:!=Author
Query2:
q: carrol
filter_by: contributor1.type:!=Author && contributor2.type:=Author && contributor3.type:!=Author
Query3:
q: carrol
filter_by: contributor1.type:!=Author && contributor2.type:!=Author && contributor3.type:=Author
And then aggregate the results on the client-side
Greg
07:55 PM1
Typesense
Indexed 3015 threads (79% resolved)
Similar Threads
Integrating Semantic Search with Typesense
Krish wants to integrate a semantic search functionality with typesense but struggles with the limitations. Kishore Nallan provides resources, clarifications and workarounds to the raised issues.
Phrase Search Relevancy and Weights Fix
Jan reported an issue with phrase search relevancy using Typesense Instantsearch Adapter. The problem occurred when searching phrases with double quotes. The team identified the issue to be related to weights and implemented a fix, improving the search results.
Fixing Multiple Document Retrieval in Typesense
Phil needed an efficient way to retrieve multiple documents by id. Kishore Nallan proposed a solution available in a pre-release build. After some bug fixing regarding id matching by Jason and Kishore Nallan, Phil successfully tested the solution.
Moving from Algolia to Typesense: Questions and Answers
Juan sought advice from Kishore Nallan about moving from Algolia to Typesense, handling MultiSearch, setting parameters, checking imported documents, and a specific syntax query.
Docsearch Scrapper Metadata Configuration and Filter Problem
Marcos faced issues with Docsearch scrapper not adding metadata attributes and filtering out documents without content. Jason helped fix the issue by updating the scraper and providing filtering instructions.