mchaput / whoosh

Pure-Python full-text search library
Other
569 stars 69 forks source link

trying to find all content containing "?" #18

Open llu13701 opened 3 years ago

llu13701 commented 3 years ago

Hi,

I am trying to find all content containing "?" and I read from the document that I could use Regex to do it... however, when I tried below,

    qp = qparser.QueryParser("comments", ix)
    qp.add_plugin(qparser.RegexPlugin())
    query_str=qp.parse(r"\?")
    results = searcher.search(query_str, limit=topN, terms=True)

I am receiving an error: TypeError: argument of type 'FileIndex' is not iterable

Not sure what I did wrong here..

mchaput commented 3 years ago

The second argument to QueryParser is the schema, not the index.

On Aug 23, 2021, at 12:53 PM, llu13701 @.***> wrote:

Hi,

I am trying to find all content containing "?" and I read from the document that I could use Regex to do it... however, when I tried below,

qp = qparser.QueryParser("comments", ix)
qp.add_plugin(qparser.RegexPlugin())
query_str=qp.parse(r"\?")

I am receiving an error: TypeError: argument of type 'FileIndex' is not iterable

Not sure what I did wrong here..

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.