Ticket #55 (closed Enhancement: fixed)

Opened 13 years ago

Last modified 13 years ago

URL topics should be indexed as "exact value" as well

Reported by: jri Owned by:
Priority: Major Milestone: Release 4.1
Component: DeepaMehta Standard Distribution Version: 4.0.2
Keywords: Cc:
Complexity: 1 Area: Model
Module: deepamehta-webbrowser

Description

Currently they are only indexed as "fulltext".
Thus, a type-save query is not possible.

Change History

comment:1 Changed 13 years ago by jri

Malte's original mail:

i have an issue with querying a dm4-server for existing URL-Topics via a GET Request and it suddenly struck me that the URL's TopicType? Definition may not have yet set it's index_mode like needed (~"dm4.core.key") to enable such a query for an existing topic -

So, if a TopicType? can have several index_modes (please correct me if i am wrong with this) i would be happy if you could add the "dm4.core.key" index_mode_uri for the upcoming release to your current URL-TopicType?-Definition - I also appended an examplary query, justin case my request is constructed badly.

### Example Query

In a "getTopicByTypeAndValue(uri, value)" i construct the following GET Request for the discussed URL but despite i do have the following URL already bookmarked there is no topic returned as a response to my query.

curl "http://localhost:8080/core/topic/dm4.webbrowser.url/value/https%3A%2%2Fgithub.com%2Fjri%2Fdeepamehta%2Fblob%2Fmaster%2Fdeepamehta-webbrowser%2Fsrc%2Fmain%2Fresources%2Fmigrations%2Fmigration1.json"
curl "http://localhost:8080/core/topic/dm4.webbrowser.url/value/https%3A%2F%2Fgithub.com%2Fjri%2Fdeepamehta%2Fblob%2Fmaster%2Fdeepamehta-webbrowser%2Fsrc%2Fmain%2Fresources%2Fmigrations%2Fmigration1.json"

see also:
https://github.com/jri/deepamehta/blob/master/deepamehta-webbrowser/src/main/resources/migrations/migration1.json

comment:2 Changed 13 years ago by jri

  • Status changed from new to closed
  • Resolution set to fixed

This is fixed now (in master).

You can query an URL topic with a given URL now. Either via Core Service API:

getTopic(String key, SimpleValue value, boolean fetchComposite)

Example:

dms.getTopic("dm4.webbrowser.url", new SimpleValue("www.deepamehta.de/docs/humans.html"), false)

Or via REST API:

curl localhost:8080/core/topic/by_value/<key>/<value>

As <key> the URI of a simple topic type can be passed.
The value must be URL-encoded, e.g.:

curl localhost:8080/core/topic/by_value/dm4.webbrowser.url/www.deepamehta.de%2Fdocs%2Fhumans.html

You must reset your DB.
(for the moment an incremental migration is not easy to provide. Please excuse.)

comment:3 Changed 13 years ago by Malte

thanks very much for the ticketing, the fix and your clear hints.. they proved very helpful!

Note: See TracTickets for help on using tickets.