whoosh icon indicating copy to clipboard operation
whoosh copied to clipboard

trying to find all content containing "?"

Open llu13701 opened this issue 3 years ago • 1 comments

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..

llu13701 avatar Aug 23 '21 16:08 llu13701

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.

mchaput avatar Aug 24 '21 15:08 mchaput