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

Elasticsearch Connector Technical Preview feedback #704

Open
JasonStoltz opened this issue Apr 11, 2022 · 17 comments
Open

Elasticsearch Connector Technical Preview feedback #704

JasonStoltz opened this issue Apr 11, 2022 · 17 comments
Labels

Comments

@JasonStoltz
Copy link
Member

JasonStoltz commented Apr 11, 2022

Thank you for using the Elasticsearch Connector for Search UI.

We have documentation on the connector and a tutorial to follow.

While the connector is in Technical Preview, we would appreciate feedback, suggestions, and bug reports.

Please use this issue to report any of the above.

@JasonStoltz JasonStoltz pinned this issue Apr 11, 2022
@JasonStoltz JasonStoltz changed the title Elasticsearch Connector -- Technical Preview feedback Elasticsearch Connector Technical Preview feedback Apr 11, 2022
@vinothdevelop
Copy link
Contributor

Elastic search connector is very useful and I started to use it immediately after available. Only thing I miss is the ability to modify request before sending to elastic search. It will help us implement complex query. Looks like it exist in App search and work place search connector. Having that would be really helpful.

@joemcelroy
Copy link
Member

Hey @vinothdevelop

Good to hear. Yes should be a straightforward addition. Created an issue here for this feature. #705

@vinothdevelop
Copy link
Contributor

Hey @vinothdevelop

Good to hear. Yes should be a straightforward addition. Created an issue here for this feature. #705

Thank you @joemcelroy, looks like the elastic connector is broken by latest version. Click events doesn't work due to error in track click action. Probably a change introduced to handle workplace search connector analytics broke it. _meta.id is not available in elastic search result object. I can send a PR but not sure if I can do it anytime soon.

@joemcelroy
Copy link
Member

joemcelroy commented Apr 20, 2022

thanks @vinothdevelop - you're correct! a couple of changes within analytics intoduced in the workplace connector caused a regression within the elasticsearch connector. Good news is i've submitted a PR with the fix. Hopefully should be able to release soon #715

Also for 1.11.0 there has been a slight change in the API. We no longer pass in queryFields and we rely on search_fields in the configuration. See documentation https://github.com/elastic/search-ui/blob/master/packages/search-ui-elasticsearch-connector/README.md#usage

@vinothdevelop
Copy link
Contributor

thanks @vinothdevelop - you're correct! a couple of changes within analytics intoduced in the workplace connector caused a regression within the elasticsearch connector. Good news is i've submitted a PR with the fix. Hopefully should be able to release soon #715

Also for 1.11.0 there has been a slight change in the API. We no longer pass in queryFields and we rely on search_fields in the configuration. See documentation https://github.com/elastic/search-ui/blob/master/packages/search-ui-elasticsearch-connector/README.md#usage

Thank you for the quick response. We are upgrading to latest version now additional detail on the search field is really helpful. Looking forward to the #715 release.

@vinothdevelop
Copy link
Contributor

Thank you @joemcelroy, Analytics issue seems to be resolved with latest update. But looks like auto complete is broken. Rawhit is not available in autocomple query response but it is accessed here https://github.com/joemcelroy/search-ui/blob/2dc4c03a2ac3d8586e7250eb13741d825d598aac/packages/search-ui-elasticsearch-connector/src/handlers/common.ts#L25
Looks like autocomplete request doesn't have includeRawHit property. Please correct me if I miss the flow.

@joemcelroy
Copy link
Member

thanks @vinothdevelop for the fix! This is now released under v1.11.2

@jennifer122105
Copy link

Brand new to ES, but I've found this connector very helpful in getting started! I'm wondering if there is any support for configuring this to use a query string query rather than a multi-match query? Or perhaps that would fall within the scope of #705 ?

@joemcelroy
Copy link
Member

joemcelroy commented May 27, 2022

hey @jennifer122105, soon you will be able to modify the elasticsearch request query before its dispatched to elasticsearch. Just waiting for a release which will be next week :)

Will feed this also back to the team to think about how we can make this more 1st class.

#754

@llermaly
Copy link

llermaly commented Jun 24, 2022

Thanks for this nice connector!. I'm trying to run setFilter on a number field (range query) but the underlying query is still being a "term" query.

Is this the way to do it?

    setFilter("price", {
      name: "price",
      from: rangePrices[0],
      to: rangePrices[1],
    });

Request query:

{
  "bool": {
    "must": [
      {
        "bool": {
          "must": [
            {
              "term": {
                "price": {
                  "name": "price",
                  "from": 365,
                  "to": 5000
                }
              }
            }
          ]
        }
      }
    ]
  }
}

Thanks

@joemcelroy

@llermaly
Copy link

A suggestion would be to allow including the "track_total_hits" option to the elastic query

@joemcelroy
Copy link
Member

hmm that looks like a bug @llermaly. Could you open up a ticket please?

@joemcelroy
Copy link
Member

A suggestion would be to allow including the "track_total_hits" option to the elastic query

You can use the escape hatch function to adjust the elasticsearch request to add track_total_hits and other parts too! https://docs.elastic.co/search-ui/api/connectors/elasticsearch#customise-the-elasticsearch-request-body

@rodeinator
Copy link

rodeinator commented Jun 29, 2022

Thanks for this connector. We tested the Facet component with filterType="none". But it doesn't translate to a must_not filter in Elasticsearch query.

<Facet
  field="comics"
  label="Comics"
  filterType={"none"}
  view={MultiCheckboxFacet}
/>

Resulting request query:

"filter" => [
  %{"bool" => %{"must" => [%{"term" => %{"comics" => "Batman"}}]}}]

When we set a filter in config.filters the query uses must_not

filters: [
      { field: "comics", values: ["Batman"], type: "none" }
]

Resulting request query:

"filter" => [
   %{"bool" => %{"must_not" => [%{"term" => %{"comics" => "Batman"}}]}}
]

@joemcelroy
Copy link
Member

thanks @rodeinator - i was hoping noone noticed this before I found a solution 😂. You're correct, it doesn't work for none and not a clear solution yet due to how Searchkit works. Could you open up a ticket please and il get back to this?

Thanks

@ColeDCrawford
Copy link

Any idea when this will get moved out of technical preview, or what steps need to occur before that happens?

@joemcelroy
Copy link
Member

we are still discussing the plans for Search UI. The plan currently is for us to:

  • GA elasticsearch-connector and introduce a major version of Search UI (2.0)
  • deprecate the other connectors like app-search
  • Provide a node API (like searchkit.co does https://www.searchkit.co/docs/proxy-elasticsearch/with-next-js) to easily proxy the connection for Elasticsearch in a safe manner
  • Introduce support for proxying with Elasticsearch search applications

Hoping to get to this in next few months. If you wish to discuss your requirements too, im available on the community slack! https://ela.st/slack

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

No branches or pull requests

7 participants