FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    I'm having an issue with Elastic Search queries in FusionAuth.

    Scheduled Pinned Locked Moved
    Q&A
    elasticsearch elastic search
    1
    2
    6.0k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • danD
      dan
      last edited by dan

      What is the best way to debug them?

      --
      FusionAuth - Auth for devs, built by devs.
      https://fusionauth.io

      1 Reply Last reply Reply Quote 0
      • danD
        dan
        last edited by

        It depends on the issue, but there are two things you can do. Note that FusionAuth typically sends the query you post to the /api/user/search endpoint with the query parameter straight through to Elasticsearch

        First, ensure you are running elasticsearch and not the database search engine.

        Then, for some queries you can see the generate ElasticSearch query strings by clicking on the 'advanced' option in the user search area of the admin UI. This can be helpful.

        Finally, try running the query directly against elasticsearch and seeing if it works. Here are examples which will pull back all the data in your elasticsearch cluster (beware!).

        curl -XPOST -H 'Content-type: application/json' "http://localhost:9021/_search" -d'
          {            
             "query": {       
               "match_all": {}
             }
          }'
        

        or, if you have the query stored in query.json

        curl -XPOST -H 'Content-type: application/json' "http://localhost:9021/_search" -d@query.json
        

        --
        FusionAuth - Auth for devs, built by devs.
        https://fusionauth.io

        1 Reply Last reply Reply Quote 0
        • First post
          Last post