Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • AbsolutelyN 22 posts 198 karma points
    1 week ago
    AbsolutelyN
    0

    Examine - searching Luke for integers

    Hi

    When building examine queries I often use Luke to test queries. For the first time I need to search on integer values and the queries are working via Examine but not in Luke. Does anyone have any idea why this may be?

    For example this query works ok:

    searcher.CreateQuery().RangeQuery<int>(fields,
                                                                    4,  4, true, true)
    

    Raw query logs to:

    { Category: , LuceneQuery: +(status:[4 TO 4]) }
    

    However if I run it direct Luke I get no results (same StandardAnalyzer):

    +(status:[4 TO 4])
    

    Running umbraco 8. Custom index on data from a database, StandardAnalyzer.

    Fields defined as integers:

    new FieldDefinition("status", FieldDefinitionTypes.Integer),
    

    Any thoughts appreciated

  • AbsolutelyN 22 posts 198 karma points
    1 week ago
    AbsolutelyN
    100

    Answer found:

    https://stackoverflow.com/questions/45516870/apache-lucene-6-queryparser-range-query-is-not-working-with-intpoint

    Seems you simply can't run a numeric raw query as it always searches for terms. Shame as it would be really handy for testing/building queries.

Please Sign in or register to post replies

Write your reply to:

Draft