Codota Logo
WikittyQueryResult.getFacets
Code IndexAdd Codota to your IDE (free)

How to use
getFacets
method
in
org.nuiton.wikitty.query.WikittyQueryResult

Best Java code snippets using org.nuiton.wikitty.query.WikittyQueryResult.getFacets (Showing top 6 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: org.nuiton.wikitty/wikitty-api

/**
 * Get map represent facets.
 *
 * return map of map
 * <li>primary key is facet name
 * <li>secondary key is topic name
 * <li>value is topic
 *
 * @return
 */
public Map<String, Map<String, FacetTopic>> getFacetsAsMap() {
  if (facetsAsMap == null && facets != null) {
    // use local variable to prevent multi-thread problem (multiple add)
    Map<String, Map<String, FacetTopic>> localFacetsAsMap =
        new HashMap<String, Map<String, FacetTopic>>();
    for (Map.Entry<String, List<FacetTopic>> e : getFacets().entrySet()) {
      Map<String, FacetTopic> topics = new HashMap<String, FacetTopic>();
      localFacetsAsMap.put(e.getKey(), topics);
      for (FacetTopic t : e.getValue()) {
        topics.put(t.getTopicName(), t);
      }
    }
    facetsAsMap = localFacetsAsMap;
  }
  return facetsAsMap;
}
origin: org.nuiton.wikitty/wikitty-api

@Override
public String toString() {
  String result = getQueryString() + " results " + getAll();
  if (!getFacetNames().isEmpty()) {
    result += "\nfacets " + getFacets();
  }
  return result;
}
origin: org.nuiton.wikitty/wikitty-api

String queryString = resultWs.getQueryString();
Map<String, List<org.nuiton.wikitty.query.FacetTopic>> facets = resultWs.getFacets();
origin: org.nuiton.wikitty/wikitty-api

@Test
public void testSearchExtensionFacet() throws Exception {
  // essai de facettiser sur les extensions
  WikittyQuery query = new WikittyQueryMaker().keyword("*").end();
  query.setOffset(0);
  query.setLimit(0);
  query.setFacetField(Element.EXTENSION);
  WikittyQueryResult<String> result = wikittyClient.findAllByQuery(query);
  Assert.assertEquals(1, result.getFacetNames().size());
  //TODO echatellier 20120112 : revue this code
  //Assert.assertNotNull(result.getFacets().get(Element.EXTENSION));
  // is more convenient, but wont work
  Assert.assertNotNull(result.getFacets().get(Element.EXTENSION.getValue()));
}
origin: org.nuiton.wikitty/wikitty-api

@Test
public void testSearchExtensionFacetExplicitly() throws Exception {
  // essai de facettiser sur les extensions
  WikittyQuery query = new WikittyQueryMaker().keyword("*").end();
  query.setOffset(0);
  query.setLimit(0);
  query.setFacetExtension(true);
  WikittyQueryResult<String> result = wikittyClient.findAllByQuery(query);
  Assert.assertEquals(1, result.getFacetNames().size());
  //TODO echatellier 20120112 : revue this code
  //Assert.assertNotNull(result.getFacets().get(Element.EXTENSION));
  // is more convenient, but wont work
  Assert.assertNotNull(result.getFacets().get(Element.EXTENSION.getValue()));
}
origin: org.nuiton.wikitty/wikitty-api

Assert.assertEquals(2, result.getFacets().get(WikittyGroup.FQ_FIELD_WIKITTYGROUP_NAME).size());
Assert.assertEquals(1, result.getFacets().get(WikittyGroup.FQ_FIELD_WIKITTYGROUP_NAME).size());
Assert.assertEquals(2, result.getFacets().get(WikittyGroup.FQ_FIELD_WIKITTYGROUP_NAME).get(0).getCount());
Assert.assertEquals(1, result.getFacets().get(WikittyGroup.FQ_FIELD_WIKITTYGROUP_NAME).size());
Assert.assertEquals(2, result.getFacets().get(WikittyGroup.FQ_FIELD_WIKITTYGROUP_NAME).get(0).getCount());
org.nuiton.wikitty.queryWikittyQueryResultgetFacets

Javadoc

Get map represent facets. return map of list
  • key is facet name
  • value is topic liste une this facet
  • Popular methods of WikittyQueryResult

    • convertMapToSimple
      if this WikittyQueryResult contains Map, and each Map contains only one value, this methode return n
    • getTopic
      Return all topic for the specified facet.
    • peek
      Return the offset element in result Can throw an exception if no element available
    • size
      Return the number of result in this object.
    • <init>
      Init paged result. we don't initialize securityToken
    • convertMapToSimpleString
    • get
      Return element at index.
    • getAll
      Return unmodifiable list of all result.
    • getFacetNames
      Return name of all facet used in query.
    • getQueryString
      query really executed (internal representation depend of search engine used
    • getTimeQuery
      temps (nanoseconde) mis pour faire la requete (calcul cote serveur)
    • getTotalResult
      total number of result if we call the query for all possible result
    • getTimeQuery,
    • getTotalResult,
    • castTo,
    • castToMap,
    • getFacetsAsMap,
    • getOffset,
    • getQueryName,
    • getSelectResult,
    • getTimeConvertion

    Popular in Java

    • Reading from database using SQL prepared statement
    • setContentView (Activity)
    • scheduleAtFixedRate (ScheduledExecutorService)
      Creates and executes a periodic action that becomes enabled first after the given initial delay, and
    • getSystemService (Context)
    • VirtualMachine (com.sun.tools.attach)
      A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
    • BufferedInputStream (java.io)
      Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
    • System (java.lang)
      Provides access to system-related information and resources including standard input and output. Ena
    • Semaphore (java.util.concurrent)
      A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
    • Modifier (javassist)
      The Modifier class provides static methods and constants to decode class and member access modifiers
    • LogFactory (org.apache.commons.logging)
      A minimal incarnation of Apache Commons Logging's LogFactory API, providing just the common Log look
    Codota Logo
    • Products

      Search for Java codeSearch for JavaScript codeEnterprise
    • IDE Plugins

      IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Codota for your IDE now