Elasticsearch - php client - term match string *


#1

I want to search the index with value like '4.1*' in a device os version field which is string field.

This is what I've in the query parameters. I used the term but it didn't return any and I know there're data in the index.

Did I do anything wrong in the query or I should use something else? Thanks.

        [query] => Array
            (
                [bool] => Array
                    (
                        [must] => Array
                            (
                                [0] => Array
                                    (
                                        [range] => Array
                                            (
                                                [@timestamp] => Array
                                                    (
                                                        [gte] => 1491004800000
                                                        [lt] => 1493337600000
                                                        [format] => epoch_millis
                                                    )

                                            )

                                    )

                                [1] => Array
                                    (
                                        [term] => Array
                                            (
                                                [device_os] => Android
                                            )

                                    )

                                [2] => Array
                                    (
                                        [term] => Array
                                            (
                                                [device_os_version] => 4.1*
                                            )

                                    )

                            )

                    )

            )

        [from] => 0
        [size] => 25
    )

(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.