Code Monkey home page Code Monkey logo

app-search-javascript's Issues

Geo-Bounding Box Query in App Search

Is your feature request related to a problem? Please describe.
We need to Geo-Bounding Box Query to filter results in a certain area and would like to use App Search to optimize our search experience.

Describe the solution you'd like
Addition of Geo-Bounding Box Query functionality to App Search api.

Describe alternatives you've considered
We've built our search using ElasticSearch api and have implemented Geo-Bounding Box Query, however, we'd like to use App Search for the search tuning features and ease of use .

Cookie set without the 'SameSite' attriubute

This issue is prompting multiple client warnings.

Using v7.8.0

A cookie associated with a cross-site resource at http://swiftype.com/ was set without the SameSiteattribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set withSameSite=NoneandSecure. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.

Disjunctive facets may break when used with signed search keys

Hello! I'm having trouble to make disjunctive facets work with signed search keys.

I think it's related to this: elastic/search-ui#347

On this line, I see that we are cleaning up request filters, but on my case filters are still sent this way:
Screenshot from 2020-06-02 11-34-24

Which seems to cause some kind of issue with AppSearch using signed search keys.

  "alerts":[{"code":5001,"message":"Degraded search results","link":"https://swiftype.com/documentation/app-search/alerts#5001"}]

What I tried:

  • If I remove filters on that request it works even with a signed search key
  • Also if I change the signed search key to a normal search key, it also works.

One last thing
My search key only applies one filter:
Screenshot from 2020-06-03 15-32-39

Any help is much appreciated!!
Thanks

Retrieve selected facets first with disjunctiveFacets

Let's say we are using the facet with the following options:

const options = {
  facets: {
    location: [{ type: 'value', size: 6 }],
  },
  disjunctiveFacets: ['location'],
  filters: { location: ['Canada', 'United States']},
};
client
  .search('yoga', options);
  .then(({ info }) => {
    console.log(info.facets.location);
  });

If the location Canada is not in the first 6 most popular facet results for this query, it is not included in info.facets.location. Only the 6 most populars are accessible. However, I can see we retrieve this data from the request that is not Facet-Only (since it returns only the two facets that we used to filter).

If we use the facets results to display checkboxes (with multiple selection active), it is a problem since the Canada option will not be shown, and then cannot be remove from the filters. We need to "cache" that selected value, and then display it without it's count.

I don't know if this should be implemented at a endpoint level, but I think the active filters should be returned as the first values when retrieving facet values, so that the UI can be implemented out-of-the-box. Even if they are empty (count = 0). That way, it will be easier to implement a UI based on them.

Indexing documents using client

Hi there,
I am creating an app using Elastic App Search and I am using app-search-javascript. I want to index documents in app search engine. Is there any way to do it using the client?

Erroneous 100 Document Limit?

Hello, I'm trying to determine the source of a given issue. We've built a working search interface as part of our application in React Native using ElasticAppSearch and this plugin. However, an issue seems to arise when we try to access documents beyond a certain point, and at a much lower level than the documentation on ElasticAppSearch would suggest.

If we call for the size of a given search request to exceed 100 documents, it always, invariably, returns just up to 100. All further requests beyond that return no results. We know for certain there are more documents than that in our engine, and have even confirmed this by checking against total results. But for whatever reason, that 100 documents limit is resolutely in place.

Do you all have any insight into this problem? Thank you.

Allow for full url specification

There are cases in which app search is being an API gateway or reverse proxy that benefits from allowing the consumer of the app-search client to specify what the end point should be.

This recently came up on a search-ui implementation where just the production environment was going to be behind a API gateway. This would require implementing a custom handler/middleware in search-ui which would be better to simply have the string concatenation for the endpoint overwritten or specified by the consumer of the SDK.

https://github.com/elastic/app-search-javascript/blob/master/src/client.js#L50

Sort using

Hi,
I am using the sort attribute on published_at (date type) for documents.
But it looks like if the document doesn't have published_at attribute, the sorting won't display the document:

"sort" :[
        { "published_at" : "desc"} 
 ]

It should sort the documents ร  the end even the attributes is missing no ?

Allow GET method for Queries to App Search API

The App Search documentation states that one can use a GET or POST request when accessing /api/as/v1/engines/{ENGINE_NAME}/search for a search query. However, app-search-javascript only allows you to utilize a POST request for this.

POST requests are meant for unique non-repeatable actions, while GET requests are intended for repeatable actions without side effects. An example of how this plays out in the real world is if you submit a POST request on page load, then attempt to refresh the page, Google Chrome will warn you with an alert pop-up asking you to "Conform Form Resubmission".

The above example can occur in @elastic/search-ui when utilizing "alwaysSearchOnInitialLoad: true". Because @elastic/search-ui utilizes @elastic/app-search-javascript as a dep, and @elastic/app-search-javascript uses POST requests by default, when alwaysSearchOnInitialLoad: true then the page will fire a POST request, and attempting to refresh the page or navigate back to it will trigger the "Confirm Form Resubmission" alert, even though the user took no action.

We should supply an option so that people utilizing the @elastic/app-search-javascript library can make the choice for themselves which method to use, based on their implementation requirements.

v8.6+ unable to import and build with Vite

When upgrading from v8.5.1 to v8.6 or v8.7 my builds start failing with Vite.

I get the following error:

Failed to resolve entry for package "@elastic/app-search-javascript". The package may have incorrect main/module/exports specified in its package.json

Any ideas?

Again I've narrowed it down to upgrading it past v8.5.1.

disable ssl

Hello, can I add SSL verify to false for the client request to the app search server through HTTPS?

Search query with minus -

Search queries with minus sign dont seem to work in Elastic App Search.

I need to be able to search "-95" and get all the SKU that contain "-95" in the SKU number but it doesn't work with the current setup. Is there a workaround?

Typo in README.md

The readme has a typo, the link to the FETCH_API documentation misses the last I (capital i).
Also the Query Suggestion example declares the options variable but does not use it.

I created a pull request to address these.

CORS on https

Hello and thanks in advance for any information you might share.

I have a repo built around this which was working fine when going from http to http API Endpoint... but when deployed into https it's run into CORS issues. Have tried pretty much everything at this point. Figured I'd check in and see if anyone can sanity check the concept in general - is there any reason why this wouldn't work over https? Should I be thinking about this more as a "public key" search client?

I don't want to get too deep into sharing code yet as I'd have to redact but if anyone can sanity check me on whether it's an appropriate use of this for https, I'd appreciate it.

Thank you!

add contributing.md

I would like to create a file contributing.md and add following -
1.Difference between GIT and GITHUB
2.How to clone,fork repository
3.How to create a branch and then use git push to push to repo
4.Create a PR
5.Squash commits in a single issue into one
6, Updating the forked and local repo as the updations are made in the upstream

Support filters in query suggestion

We have a use case where we would like to add filters in query suggestion (e.g. filter out disabled products). Elastic Search itself supports the use case, however, app search doesn't support filters yet. Could you add the support? Thanks in advance!

App search query suggestion doc - https://www.elastic.co/guide/en/app-search/current/query-suggestions-guide.html
Elastic Search suggester doc - https://www.elastic.co/guide/en/elasticsearch/reference/current/search-suggesters.html

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.