Skip to content
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

Lucene query always throw not JsonObject error #17279

Open
gaojianzhuang opened this issue Dec 25, 2024 · 1 comment
Open

Lucene query always throw not JsonObject error #17279

gaojianzhuang opened this issue Dec 25, 2024 · 1 comment

Comments

@gaojianzhuang
Copy link

gaojianzhuang commented Dec 25, 2024

Describe the bug

Click the query button, always throw errors as below:
Invalid query : The node must be of type 'JsonObject'.

image

Actually, the query body is a json object.

{
  "query":{
    "bool":{
      "must":{
        "term":{
          "Content.ContentItem.ContentType":"Product"
        }
      },
      "filter":[
        {
          "term":{
            "Content.ContentItem.Published":"true"
          }
        }
      ]
    }
  }
}

If I removed the "filter" node, it works well.

Orchard Core version

Orchardcore: 2.1.3

To Reproduce

  1. Go to '...'
  2. Click on '...'
  3. Scroll down to '...'
  4. See error

Expected behavior

It should work with the "filter" query.

Logs and screenshots

@Piedone
Copy link
Member

Piedone commented Dec 26, 2024

This appears to be working in latest main, please confirm. Just to be sure, I used this query (not having a Product type, used BlogPost, but this shouldn't matter):

{
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "Content.ContentItem.ContentType": "BlogPost"
          }
        },
        {
          "term": {
            "Content.ContentItem.Published": "true"
          }
        }
      ]
    }
  }
}

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

No branches or pull requests

2 participants