How can i pinned the documents in elastic search?

How can i pinned the documents in elastic search?

See https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-pinned-query.html

But how can i add documents, it is not mentioned there?

there is only GET request, how can i use(pinned query) for post request?

Like you put any document I guess.

yes, how can i pinned the documents on keywords, there is not any documentation there?

That's the bit you build but if you choose to use elastic's app-search that is done for you

2 Likes

When the build will release?
I want to use this using elasticsearch api

It is not an elasticsearch API. It is an elastic product built on top of elasticsearch and available now.
It has an API for registering products against keywords if you don't want to use the admin GUI.

can i register the documents (pinned) the documents, using the below query?
{
  "id": "cur-a5b6c7",
  "queries": [
    "banana", "bananana", "bonana", "nanner"
  ],
  "promoted": [
    "doc-123", "doc-a2b3c4", "doc-456"
  ],
  "hidden": [
    "doc-a9b87c", "doc-789", "doc-a7b6c5"
  ]
}
I have register the documents (pinned) the documents, using the below query

POST /test_products2/_doc
{
  "id": "cur-a5b6c7",
  "queries": [
    "computer", "computers", "desktop"
  ],
  "promoted": [
    "23993822", "23989783"
  ]
}

But when i search using the below query, i am not getting promoted results

GET /test_products2/_search
{
    "query": {
        "pinned" : {
            "ids" : ["cur-a5b6c7"],
            "organic" : {
            	"match":{
            		"name": "computer"
            	}
            }
        }
    }
}

You’re using the elasticsearch api not the app-search api.

is there any documentation for app-search api?

Here is a link to the docs, which cover installation as well as the APIs:
https://www.elastic.co/guide/en/app-search/current/index.html

can i not pinned the documents in elastic search? 
when i am using the below queries in elasticsearch,
POST /test_products2/_doc
{
  "id": "cur-a5b6c7",
  "queries": [
    "computer", "computers", "desktop"
  ],
  "promoted": [
    "23993822", "23989783"
  ]
}

 I am getting the below response, it is showing created, but not getting promoted results in elasticsearch requests

{
  "_index" : "test_products2",
  "_type" : "_doc",
  "_id" : "YWQ4CXMB5t94jVz3SdaQ",
  "_version" : 1,
  "result" : "created",
  "_shards" : {
    "total" : 2,
    "successful" : 2,
    "failed" : 0
  },
  "_seq_no" : 1602,
  "_primary_term" : 1
}

It’s been fun but I’m done here

2 Likes

As Mark explained, building a good search experience on top of Elasticsearch required a good amount of development. Some features may require multiple calls to Elasticsearch behind the scenes so it is not just about crafting queries.

A lot of this work has been done in the app search product, which provides an abstraction on top of Elasticsearch and higher level APIs. Based on your questions so far I think you would be better off building on top of app search as it would allow you to reach your goal faster.

That is all I have to say about this. Good luck!

1 Like

According to your below suggestion:

"Here is a link to the docs, which cover installation as well as the APIs:
https://www.elastic.co/guide/en/app-search/current/index.html"

Is curations features will work with 7.8?

Yes, it is covered in the docs for 7.8.

Go through the installation guide to get it set up and then have a look at the getting started guide before diving into the APIs.

I have some questions
Is the curation feature not available in 7.4?

Is the curation dashboard will show in the 7.8?