Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.0.2
    • 2.0.3
    • None
    • None
    • 1

    Description

      Trying to convert from v1 to v2 and its not clear from the docs what i need to do in order to successfully get it to work

      v1 code

      q := query

      {Query:"field:value",From:  offset,Limit: limit}

      query := gocb.NewSearchQuery(indexName, q).Limit(limit).Skip(offset)

      result, err := bucket.ExecuteSearchQuery(query)

       

      v2 code (from what i could scrap in the source code)
      results, err := cluster.SearchQuery(indexName, gocbsearch.NewMatchQuery("field:value"), &gocb.SearchOptions{Limit: limit,Skip: offset})

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            Brian Voelker I'm unsure that there is an issue here, if there's a bug then feel free to reopen. Our forums may be a better place for questions like this (https://forums.couchbase.com/), our docs site also has search queries at https://docs.couchbase.com/go-sdk/2.0/howtos/full-text-searching-with-sdk.html.

            charles.dixon Charles Dixon added a comment - Brian Voelker I'm unsure that there is an issue here, if there's a bug then feel free to reopen. Our forums may be a better place for questions like this ( https://forums.couchbase.com/ ), our docs site also has search queries at https://docs.couchbase.com/go-sdk/2.0/howtos/full-text-searching-with-sdk.html .

            Ill add it to the forum. But I dont see any tests for NewQueryStringQuery and the only search test is using mocks so im not sure how you even know its working.

            I can use the couchbase ui and get results but as soon as i run the code via go i dont get results. Ill add it here just in case you want to see it

            results, err := cluster.SearchQuery("full_customer_vault", gocbsearch.NewQueryStringQuery("owner_id:testmerchant12345678"), &gocb.SearchOptions{Limit: 10})
            

            bvoelker Brian Voelker added a comment - Ill add it to the forum. But I dont see any tests for NewQueryStringQuery and the only search test is using mocks so im not sure how you even know its working. I can use the couchbase ui and get results but as soon as i run the code via go i dont get results. Ill add it here just in case you want to see it results, err := cluster.SearchQuery( "full_customer_vault" , gocbsearch.NewQueryStringQuery( "owner_id:testmerchant12345678" ), &gocb.SearchOptions{Limit: 10 })
            charles.dixon Charles Dixon added a comment - - edited

            Hi Brian Voelker, so the issue is that you don't get any results? I realised if that's the case then you will want to upgrade to v2.0.3 released yesterday as there was a bugfix (https://issues.couchbase.com/browse/GOCBC-814) related to search results.

            Re: Testing, just to reassure you we do test against Couchbase Server itself. Our testing actually has 3 levels. We have split the testing into unit and integration test suites. Our CI runs the unit and integration tests every commit but it only runs the integration tests against the Couchbase Mock for commit validation. Every day (and on every release) we run these same tests but also run an extra set - the integration tests are run against several real Couchbase Server versions. v2.0.3 has seen us improve our testing coverage significantly so you should see the SDK being more stable now.

            charles.dixon Charles Dixon added a comment - - edited Hi Brian Voelker , so the issue is that you don't get any results? I realised if that's the case then you will want to upgrade to v2.0.3 released yesterday as there was a bugfix ( https://issues.couchbase.com/browse/GOCBC-814 ) related to search results. Re: Testing, just to reassure you we do test against Couchbase Server itself. Our testing actually has 3 levels. We have split the testing into unit and integration test suites. Our CI runs the unit and integration tests every commit but it only runs the integration tests against the Couchbase Mock for commit validation. Every day (and on every release) we run these same tests but also run an extra set - the integration tests are run against several real Couchbase Server versions. v2.0.3 has seen us improve our testing coverage significantly so you should see the SDK being more stable now.

            Ok thats reassuring. Ill try out 2.0.3. Thanks.

            bvoelker Brian Voelker added a comment - Ok thats reassuring. Ill try out 2.0.3. Thanks.

            Just tested it with 2.0.3 and it works now.

            bvoelker Brian Voelker added a comment - Just tested it with 2.0.3 and it works now.

            People

              charles.dixon Charles Dixon
              bvoelker Brian Voelker
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty