## TL;DR

All you have to do is pass another keyword argument search\_method="LEXICAL" to the.search() method here is how your code should look like: `` result = mq.index("my-index").search(q='keyword', search\_method="LEXICAL") ` Context: Stack Overflow #74405390 (accepted answer, 3 votes): i have been searching through documents in marqo by passing a query as an argument to the.search() method but this returns a list of documents from best to least match. i will like to pass a keyword from the document and i should only get the documents that have those keyword this is how i currently search: ` result

## Steps

1. All you have to do is pass another keyword argument `search_method="LEXICAL"` to the `.search()` method here is how your code should look like:

``` result = mq.index("my-index").search(q='keyword', search_method="LEXICAL") ```

``` results = mq.index("my-index").search( q="keyword" ) ```

2. this is how the output look like: ``` {'hits': [{'Description': "document_1_description", 'Title': 'document_1_title', '_highlights': best_match, '_id': 'd65454db-680c-4f77-8c82-f9aaea66efa1', '_score': 0.5562359},...

## When to use

Use this skill when you run into "How to perform a keyword search in marqo".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
