# Programmatically updating search results

**URL:** <https://discuss.codelibs.org/t/programmatically-updating-search-results/1010>\
**Category:** English:Fess\
**Created:** [April 4, 2017, 10:58am UTC](https://discuss.codelibs.org/t/programmatically-updating-search-results/1010 "2017-04-04T10:58:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![discuss](https://discuss.codelibs.org/user_avatar/discuss.codelibs.org/discuss/32/298_2.png) [@discuss](https://discuss.codelibs.org/u/discuss)\
**Post date:** [April 4, 2017, 10:58am UTC](https://discuss.codelibs.org/t/programmatically-updating-search-results/1010/1 "2017-04-04T10:58:10Z")

</div>

(from [github.com/micakovic](http://github.com/micakovic))  
When performing search queries in Fess web app, results are built with href links that look like this (example values):

```auto
<a class="link" href="/go/?rt=1491302202658&amp;docId=c684b94fac6b42c4b01dbfa7e1c046e2&amp;queryId=be33a1e17ced43c1b236d1d37e8c59a7&amp;order=0" data-uri="..." data-id="c684b94fac6b42c4b01dbfa7e1c046e2" data-order="0">...</a>

```

These values can be obtained from the response object when performing json queries:

```auto
docId
queryId
data-order

```

These are not part of the response object:

```auto
rt
data-id

```

In order to increase scoring when building custom views which are not part of the Fess user interface, one would have to construct build links using the same scheme, right? Clicking on those links would take the user to the Fess server, then immediately redirect to the requested page, while other bits of the business logic such as increasing the score value for the clicked link are performed by Fess. If this is correct, how can the ‘rt’ field, which seems to be obligatory, be obtained when working with json?

Alternatively, is there another way of programmatically updating the backend with the number of clicks, or the number of likes, so that clicks on interfaces which are independent of the Fess web app are also accounted for?

---

<div class="post-metadata">

**Author:** ![discuss](https://discuss.codelibs.org/user_avatar/discuss.codelibs.org/discuss/32/298_2.png) [@discuss](https://discuss.codelibs.org/u/discuss)\
**Post date:** [April 4, 2017, 3:00pm UTC](https://discuss.codelibs.org/t/programmatically-updating-search-results/1010/2 "2017-04-04T15:00:29Z")

</div>

(from [github.com/marevol](http://github.com/marevol))  
data-id is docId.  
rt is query request time(unix time), it means when do you send the query, so it’s managed in your application.

Currently, click count is one of sort orders, and it does not affect scoring. (but it might be changed in the future release)

click count is in fess.YYYYMMDD index. To modify it, please send update requests to elasticsearch.

---

<div class="post-metadata">

**Author:** ![discuss](https://discuss.codelibs.org/user_avatar/discuss.codelibs.org/discuss/32/298_2.png) [@discuss](https://discuss.codelibs.org/u/discuss)\
**Post date:** [April 4, 2017, 3:04pm UTC](https://discuss.codelibs.org/t/programmatically-updating-search-results/1010/3 "2017-04-04T15:04:12Z")

</div>

(from [github.com/micakovic](http://github.com/micakovic))  
Is there a plan to include click count updates in some future Fess release? Like so, elasticsearch would not have to be exposed at all, apart from being exposed to Fess itself.

---

<div class="post-metadata">

**Author:** ![discuss](https://discuss.codelibs.org/user_avatar/discuss.codelibs.org/discuss/32/298_2.png) [@discuss](https://discuss.codelibs.org/u/discuss)\
**Post date:** [April 4, 2017, 3:21pm UTC](https://discuss.codelibs.org/t/programmatically-updating-search-results/1010/4 "2017-04-04T15:21:16Z")

</div>

(from [github.com/marevol](http://github.com/marevol))  
It might be implemented as one of Admin API in Fess 11.1…

---

<div class="post-metadata">

**Author:** ![discuss](https://discuss.codelibs.org/user_avatar/discuss.codelibs.org/discuss/32/298_2.png) [@discuss](https://discuss.codelibs.org/u/discuss)\
**Post date:** [May 8, 2017, 9:53pm UTC](https://discuss.codelibs.org/t/programmatically-updating-search-results/1010/5 "2017-05-08T21:53:04Z")

</div>

(from [github.com/efridge](http://github.com/efridge))  
I’d love to see this feature as well. We are adapting FESS to be a site search and I’d like to see the user click actions able to feed back into the search engine through the API. This way, the popularity of a document on our site can be used to influence its relevance.

---

<div class="post-metadata">

**Author:** ![discuss](https://discuss.codelibs.org/user_avatar/discuss.codelibs.org/discuss/32/298_2.png) [@discuss](https://discuss.codelibs.org/u/discuss)\
**Post date:** [May 10, 2017, 1:26pm UTC](https://discuss.codelibs.org/t/programmatically-updating-search-results/1010/6 "2017-05-10T13:26:58Z")

</div>

(from [github.com/marevol](http://github.com/marevol))  
It will be in Fess 11.2…

---

<div class="post-metadata">

**Author:** ![discuss](https://discuss.codelibs.org/user_avatar/discuss.codelibs.org/discuss/32/298_2.png) [@discuss](https://discuss.codelibs.org/u/discuss)\
**Post date:** [July 10, 2017, 1:02pm UTC](https://discuss.codelibs.org/t/programmatically-updating-search-results/1010/7 "2017-07-10T13:02:20Z")

</div>

(from [github.com/micakovic](http://github.com/micakovic))  
I’m curious: did this feature make it into 11.2 or 11.2.1?

---

<div class="post-metadata">

**Author:** ![discuss](https://discuss.codelibs.org/user_avatar/discuss.codelibs.org/discuss/32/298_2.png) [@discuss](https://discuss.codelibs.org/u/discuss)\
**Post date:** [July 10, 2017, 9:27pm UTC](https://discuss.codelibs.org/t/programmatically-updating-search-results/1010/8 "2017-07-10T21:27:41Z")

</div>

(from [github.com/marevol](http://github.com/marevol))  
[Admin API](https://github.com/codelibs/fess/blob/master/src/main/java/org/codelibs/fess/app/web/api/admin/searchlist/ApiAdminSearchlistAction.java) supports it, but there is no document at the moment…
