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

Not equal operator not working anymore on SMW 4.1.3 (ElasticStore) ? #5618

Open
bertrandgorge opened this issue Apr 4, 2024 · 3 comments
Open
Labels
bug Occurrence of an unintended or unanticipated behaviour that causes a vulnerability or fatal error

Comments

@bertrandgorge
Copy link
Contributor

Setup

  • SMW version: 4.1.3
  • MW version: 1.39.7
  • PHP version: 8.2.17
  • DB system (MySQL, Blazegraph, etc.) and version: MySQL 5.7.44
  • ElasticStore - Elasticsearch: 7.10.2

https://wiki.tripleperformance.fr/wiki/Sp%C3%A9cial:Version

Issue

The not equal operator does not seem to work anymore...!

This search string does not return anything: [[A la une::True]][[A un type de page::!Fiche technique]] when [[A la une::True]] clearly has several results with different A un type de page....

All results with different types ([[A la une::True]]): https://wiki.tripleperformance.fr/index.php?title=Sp%C3%A9cial:Ask&x=-5B-5BA-20la-20une%3A%3Avrai-5D-5D%2F-3FA-20un-20type-20de-20page&format=broadtable&limit=50&link=all&headers=show&searchlabel=...%20autres%20r%C3%A9sultats&class=sortable%20wikitable%20smwtable&prefix=none&sort=&order=asc&offset=0&mainlabel=

When using the debug query button, I get this:

{
    "smw": {
        "query": "[[A la une::True]][[A un type de page::!Fiche technique]]",
        "sort": {
            "": "ASC"
        },
        "metrics": {
            "query size": 4,
            "query depth": 1
        },
        "description_log": [
            {
                "Conjunction": "[[A la une::vrai]] [[A un type de page::!Fiche technique]]"
            },
            [
                {
                    "SomeProperty": "[[A la une::vrai]]"
                }
            ],
            [
                [
                    {
                        "SomeProperty": "[[A un type de page::!Fiche technique]]"
                    }
                ]
            ]
        ]
    },
    "elastic": [
        {
            "index": "smw-data-wiki_prod",
            "body": {
                "_source": false,
                "from": 0,
                "size": 51,
                "query": {
                    "constant_score": {
                        "filter": {
                            "bool": {
                                "must": [
                                    {
                                        "bool": {
                                            "filter": {
                                                "term": {
                                                    "P:37056.booField": true
                                                }
                                            }
                                        }
                                    },
                                    [
                                        {
                                            "exists": {
                                                "field": "P:27055.txtField"
                                            }
                                        },
                                        {
                                            "bool": {
                                                "must_not": {
                                                    "term": {
                                                        "P:27055.txtField.keyword": "Fiche technique"
                                                    }
                                                }
                                            }
                                        }
                                    ]
                                ]
                            }
                        }
                    }
                },
                "sort": [
                    {
                        "subject.sortkey.sort": {
                            "order": "asc"
                        },
                        "subject.title.sort": {
                            "order": "asc"
                        }
                    }
                ]
            }
        },
        {
            "valid": false,
            "error": "ParsingException[Failed to parse]; nested: XContentParseException[[1:110] [bool] failed to parse field [must]]; nested: IllegalStateException[expected value but got [START_ARRAY]];; org.elasticsearch.common.xcontent.XContentParseException: [1:110] [bool] failed to parse field [must]"
        }
    ]
}
@bertrandgorge bertrandgorge added the bug Occurrence of an unintended or unanticipated behaviour that causes a vulnerability or fatal error label Apr 4, 2024
@krabina
Copy link
Contributor

krabina commented Apr 4, 2024

@marijnvanwezel can you confirm this?

@marijnvanwezel
Copy link
Contributor

We have not come across this, but it may be similar to #5544.

@bertrandgorge
Copy link
Contributor Author

The double array for the SomeProperty attribute in the description log seems suspicious to me, or is it not?

When I do the same query, but with [[A la une::vrai]] [[A un type de page::Fiche technique]] I get (where there's no such double array):

{
    "smw": {
        "query": "[[A la une::vrai]] [[A un type de page::Fiche technique]]",
        "sort": {
            "": "ASC"
        },
        "metrics": {
            "query size": 4,
            "query depth": 1
        },
        "description_log": [
            {
                "Conjunction": "[[A la une::vrai]] [[A un type de page::Fiche technique]]"
            },
            [
                {
                    "SomeProperty": "[[A la une::vrai]]"
                }
            ],
            [
                {
                    "SomeProperty": "[[A un type de page::Fiche technique]]"
                }
            ]
        ]
    },
    "elastic": [
        {
            "index": "smw-data-wiki_prod",
            "body": {
                "_source": false,
                "from": 0,
                "size": 51,
                "query": {
                    "constant_score": {
                        "filter": {
                            "bool": {
                                "must": [
                                    {
                                        "bool": {
                                            "filter": {
                                                "term": {
                                                    "P:37056.booField": true
                                                }
                                            }
                                        }
                                    },
                                    {
                                        "bool": {
                                            "filter": {
                                                "term": {
                                                    "P:27055.txtField.keyword": "Fiche technique"
                                                }
                                            }
                                        }
                                    }
                                ]
                            }
                        }
                    }
                },
                "sort": [
                    {
                        "subject.sortkey.sort": {
                            "order": "asc"
                        },
                        "subject.title.sort": {
                            "order": "asc"
                        }
                    }
                ]
            }
        },
        {
            "_shards": {
                "total": 1,
                "successful": 1,
                "failed": 0
            },
            "valid": true,
            "explanations": [
                {
                    "index": "smw-data-wiki_prod-v2",
                    "valid": true,
                    "explanation": "ConstantScore(+(#P:37056.booField:T) +(#P:27055.txtField.keyword:Fiche technique))"
                }
            ]
        }
    ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Occurrence of an unintended or unanticipated behaviour that causes a vulnerability or fatal error
Projects
None yet
Development

No branches or pull requests

3 participants