Hello, with regular text search (not vector) for m...
# community-help
j
Hello, with regular text search (not vector) for multiple attributes, looking at the following query - I'm seeing extremely poor performance (30+ seconds for response), and only fetching 1 document in my database of 700k listings.
jobDescription
is quite a long field, and
requiredSkills
is typically an array of strings of skills, is there a way to improve the performance of this query, as well as consider each and every token This query seems to require every skill provided to be present, but I'd like to have it return the most token matches to least in the results
Copy code
{
  "indexName": "listings",
  "query": "Database Administrator Microsoft SQL Server 2000 Microsoft SQL Server 2005 Microsoft SQL Server 2008 Disaster recovery SQL skills Sybase Oracle DBA Data cleansing Data Warehouse tools Oracle Application Servers SAN NAS XMLDB RAC ASM Instance tuning SQL tuning PHP XHTML CSS JavaScript OEM Diagnostic Tuning Configuration Change Management Packs",
  "queryBy": "jobTitle,jobDescription,requiredSkills",
  "queryByWeights": "2,1,3",
  "prefix": "false,false,true",
  "includeFields": [
    "*"
  ],
  "page": 1,
  "perPage": 25,
  "filterBy": "status:!=expired"
}
It seems like vector search is not optimal for UX where we need sorting/pagination, so we are hoping that standard multi-attribute fulltext search will suffice
k
Such long queries are not a typical use case for Typesense.
1
j
update - adding this with
vectoryQuery
is performing very well
Copy code
const params = {
  indexName: 'listings',
  query: `${jobTitle} ${skills.map(skill => skill.name).join(' ')} ${summary}`,
  queryBy: 'embedding',
  vectorQuery: 'embedding:([], k:10000, distance_threshold:1.0)',
  ...(sortType === 'mostRecent' && { sortBy: 'createdAt:desc' }),
  includeFields: ['*'],
  page: page.value,
  perPage: 10,
  filterBy: filters.concat({ status: 'active' }),
}