Skip to content

Fix NOCONTENT + PAYLOAD in search #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Conversation

TvoroG
Copy link

@TvoroG TvoroG commented Jul 17, 2018

Hi! Thanks for redisearch!

I'm trying to use PAYLOAD with NOCONTENT. redisearch-py returns incorrect ids and payloads in current implementation. So this test will fail:

    def testPayloadsWithNoContent(self):
        conn = self.redis()

        with conn as r:
            # Creating a client with a given index name
            client = Client('idx', port=conn.port)
            client.redis.flushdb()
            client.create_index((TextField('txt'),))

            client.add_document('doc1', payload = 'foo baz', txt = 'foo bar')
            client.add_document('doc2', payload = 'foo baz2', txt = 'foo bar')

            q = Query("foo bar").with_payloads().no_content()
            res = client.search(q)

            self.assertEqual(2, len(res.docs))
======================================================================
FAIL: testPayloadsWithNoContent (__main__.RedisSearchTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test.py", line 214, in testPayloadsWithNoContent
    self.assertEqual(2, len(res.docs[0].id))
AssertionError: 2 != 4

But I'm not sure it is correct to use PAYLOAD and NOCONTENT together or no because i've found this comment in source code: # we can't have nocontent and payloads in the same response.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
0 out of 2 committers have signed the CLA.

❌ TvoroG
❌ gkorland
You have signed the CLA already but the status is still pending? Let us recheck it.

@gkorland gkorland requested a review from itamarhaber March 13, 2019 07:43
@gkorland gkorland requested a review from mnunberg February 9, 2020 10:32
@MeirShpilraien
Copy link

Is it possible to introduce only the actual code changes (without the spaces/new line changes)?
Also it need to be rebased from master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants