Commit cda3a43e authored by Malte Reißig's avatar Malte Reißig

0.3.0 release

parent 905783a3
# DeepaMehta 4 Little Helpers
A plugin service supporting http://github.com/mukil/stableviews, in particular trough delivering the
A plugin utility service and HTTP API endpoint to query, sort, filter and enrich DeepaMehta 4 topics in Lists.
- custom search results (usable in a frontend/command line as topic and/or entity suggestions)
- a model to personalize your session, like e.g. your gui language setting or your favourite stylesheet
Developed to support the http://github.com/mukil/stableviews plugin, in particular trough delivering the
Currently there have not been any releases, just some source code.
- viewmodel items
- timerange queries
- custom search results (to be used in a frontend/command line as topic and/or entity suggestions)
## Release History
**0.3.0** -- Nov 15, 2016
* Basically workgin
--------------------------
Author: Malte Reißig, 2015
Author: Malte Reißig, 2015-16
......@@ -7,7 +7,7 @@
<name>DeepaMehta 4 Little Helpers</name>
<groupId>org.deepamehta</groupId>
<artifactId>dm48-littlehelpers</artifactId>
<version>0.3-SNAPSHOT</version>
<version>0.3.0</version>
<packaging>bundle</packaging>
<parent>
......
......@@ -70,6 +70,7 @@ public class HelperPlugin extends PluginActivator implements HelperService {
public List<SearchResult> getSuggestedSearchableUnits(@PathParam("input") String query) {
if(query == null || query.length() < 2) throw new IllegalArgumentException("To receive "
+ "suggestions, please provide at least two characters.");
// ### Todo authorize request (maybe restrict to logged in users only)
// fire three explicit searches: for topicmap name, usernames and note-titles ### add IndexMode.FULLTEXT_KEY ?
List<Topic> searchResults = getTopicSuggestions(query, "dm4.topicmaps.name");
searchResults.addAll(getTopicSuggestions(query, "dm4.notes.title"));
......@@ -77,20 +78,21 @@ public class HelperPlugin extends PluginActivator implements HelperService {
// fire another global fulltext search
List<Topic> fulltextSearch = dm4.searchTopics(query + "*", null);
if (fulltextSearch != null) {
log.info("Naive search " + fulltextSearch.size() + " length");
log.info("Fulltext Search for \""+query+"*\" we found \"" + fulltextSearch.size() + "\" and in "
+ "Topicmap Name, Notes Title and Username we found \"" + searchResults.size() + "\" topics");
searchResults.addAll(fulltextSearch);
}
log.info("> Checking for searchable units.. in " + searchResults.size() );
List<Topic> newResults = findSearchableUnits(searchResults);
List<SearchResult> suggestions = new ArrayList<SearchResult>();
for (Topic t : newResults) {
SearchResult result = new SearchResult(t, wsService.getAssignedWorkspace(t.getId()));
if (!suggestions.contains(result)) {
log.fine("Suggesting \"" + t.getSimpleValue() + "\" topics (workspace=" + wsService.getAssignedWorkspace(t.getId())+ ")");
log.fine("Suggesting \"" + t.getSimpleValue() + "\" topics (workspace=" +
wsService.getAssignedWorkspace(t.getId())+ ")");
suggestions.add(result);
}
}
log.info("Suggesting " + suggestions.size() + " topics for input \"" + query + "\"");
log.info("Suggesting " + suggestions.size() + " searchable units for input \"" + query + "\"");
return suggestions;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment