Comments (3)
Hi @jess-lord . Thanks for raising this issue. Is your requirement to search only based on a filter with no query? Or do you intend to use the wildcard potentially as part of a string? e.g. q="somevalue*"
for a prefix search
In the meantime, I believe having q="Trolling"
with a filter could in fact give you the desired outcome. Your query might match content=Troll
due to linguistic processing (stemming), but the filter will eliminate those results.
Here's an example I just tried
ix.add_documents(
documents=[
{
'_id': '1',
'title': 'Trolling',
'topic': 'Fun'
, },
{
'_id': '2',
'title': 'Troll',
'topic': 'Fun'
, }
],
tensor_fields=[]
)
response = ix.search(q='Trolling', limit=10, search_method="lexical", filter_string='NOT topic:(Trolling) AND title:(Trolling)')
response['hits']
Results:
[{'title': 'Trolling',
'topic': 'Fun',
'_id': '1',
'_score': 0.1823215567939546,
'_highlights': []}]
As you can see, this didn't return the document with title=Troll
.
from marqo.
@farshidz Thanks for looking into this. I'm looking for exact token matches, so "troll" should match "the troll under the bridge" but not "the trolling of online forums". The use case is to search marqo document content for important keywords that need an exact match. So the filter would target the "content" property of the documents. Maybe a more abstract example is easier:
ix.add_documents(
documents=[
{
'_id': '1',
'content': 'lorem ipusm abc1 lorem',
'topic': ''
, },
{
'_id': '2',
'content': 'lorem ipusm abc110 lorem',
'topic': ''
, }
],
tensor_fields=[content]
)
In this example my objective is to filter the index for docs with content of abc1, and tag all matching results with a topic of genreA, and tag docs containing abc110 with genreB. When filtering for "abc1" I don't want to get this second document.
from marqo.
Related Issues (20)
- Help installing container on TrueNAS Scale (containerd) HOT 6
- [BUG] Add documents validation failure when use_existing_tensors=True
- [BUG] Docker container does not run on M1 Mac HOT 4
- [ENHANCEMENT] Disk persistent storage configuration HOT 1
- Usage on Google Cloud Platform
- [ENHANCEMENT] Marqo on Azure HOT 1
- ONNX Support - CPU HOT 1
- [BUG] Cannot pull docker image on latest 2.1.0 HOT 1
- Marqo Integration into cacheGPT HOT 1
- Error Status: 400 after using add_documents() to add the images from docker to index
- Marqo encountered an unexpected internal error, status_code: 500[BUG] HOT 1
- Support OpenAPI spec generation [ENHANCEMENT]
- [ENHANCEMENT] Allow Pydantic > 2 HOT 3
- Unable to delete index [BUG] HOT 5
- [ENHANCEMENT] Nicer error message if not enough memory HOT 1
- [ENHANCEMENT] Highlighting Exact Matches HOT 2
- [BUG] This is a test HOT 1
- [BUG] HOT 2
- [BUG] Error ingesting simple wiki using simple_wiki_demo script HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from marqo.