Package org.rssowl.core.persist

Examples of org.rssowl.core.persist.SearchSpecifier


      bQuery.add(new TermQuery(new Term(String.valueOf(INews.PARENT_ID), NumberTools.longToString(newsbin.getId()))), Occur.SHOULD);
  }

  @SuppressWarnings("unchecked")
  private static Query createStringQuery(Analyzer analyzer, ISearchCondition condition) throws ParseException, IOException {
    SearchSpecifier specifier = condition.getSpecifier();
    String fieldname = String.valueOf(condition.getField().getId());

    /* Retrieve Value */
    String value;
    if (condition.getValue() instanceof Enum)
View Full Code Here


    Term term = new Term(fieldname, value);
    return new TermQuery(term);
  }

  private static Query createDateQuery(ISearchCondition condition) {
    SearchSpecifier specifier = condition.getSpecifier();
    String value = DateTools.dateToString((Date) condition.getValue(), Resolution.DAY);
    String fieldname = String.valueOf(condition.getField().getId());

    switch (specifier) {
      case IS:
View Full Code Here

    throw new UnsupportedOperationException("Unsupported Specifier for Date/Time Queries"); //$NON-NLS-1$
  }

  private static Query createNumberQuery(ISearchCondition condition) {
    SearchSpecifier specifier = condition.getSpecifier();
    String value = NumberTools.longToString((Integer) condition.getValue());
    String fieldname = String.valueOf(condition.getField().getId());

    switch (specifier) {
      case IS:
View Full Code Here

      conditions.add(locationCondition);
    }

    /* Match on Pattern */
    ISearchField field = null;
    SearchSpecifier specifier = SearchSpecifier.CONTAINS_ALL;
    switch (fSearchTarget) {
      case ALL:
        field = fModelFactory.createSearchField(IEntity.ALL_FIELDS, INews.class.getName());
        break;

View Full Code Here

      bQuery.add(new TermQuery(new Term(String.valueOf(INews.PARENT_ID), NumberTools.longToString(newsbin.getId()))), Occur.SHOULD);
  }

  @SuppressWarnings("unchecked")
  private static Query createStringQuery(Analyzer analyzer, ISearchCondition condition) throws ParseException, IOException {
    SearchSpecifier specifier = condition.getSpecifier();
    String fieldname = String.valueOf(condition.getField().getId());

    /* Retrieve Value */
    String value;
    if (condition.getValue() instanceof Enum)
View Full Code Here

    Term term = new Term(fieldname, value);
    return new TermQuery(term);
  }

  private static Query createDateQuery(ISearchCondition condition) {
    SearchSpecifier specifier = condition.getSpecifier();
    String value = DateTools.dateToString((Date) condition.getValue(), Resolution.DAY);
    String fieldname = String.valueOf(condition.getField().getId());

    switch (specifier) {
      case IS:
View Full Code Here

    throw new UnsupportedOperationException("Unsupported Specifier for Date/Time Queries"); //$NON-NLS-1$
  }

  private static Query createNumberQuery(ISearchCondition condition) {
    SearchSpecifier specifier = condition.getSpecifier();
    String value = NumberTools.longToString((Integer) condition.getValue());
    String fieldname = String.valueOf(condition.getField().getId());

    switch (specifier) {
      case IS:
View Full Code Here

        ISearchField field = condition.getField();
        if (field.getId() != INews.LOCATION)
          continue;

        /* Check on Search Specifier */
        SearchSpecifier specifier = condition.getSpecifier();
        if (specifier != SearchSpecifier.IS)
          continue;

        /* Check on Search Value */
        Object value = condition.getValue();
View Full Code Here

    /* Search Specifier */
    Element specifierElement = conditionElement.getChild(Tag.SPECIFIER.get(), RSSOWL_NS);
    if (specifierElement == null)
      return null;
    SearchSpecifier searchSpecifier = SearchSpecifier.values()[Integer.parseInt(specifierElement.getAttributeValue(Attributes.ID.get()))];

    /* Search Value */
    Element valueElement = conditionElement.getChild(Tag.SEARCH_VALUE.get(), RSSOWL_NS);
    if (valueElement == null)
      return null;
View Full Code Here

    List<ISearchField> fields = new ArrayList<ISearchField>();
    fields.add(allField);
    fields.add(attachmentField);

    for (ISearchField field : fields) {
      SearchSpecifier specifier = (field.getId() == IEntity.ALL_FIELDS) ? SearchSpecifier.CONTAINS_ALL : SearchSpecifier.IS;

      ISearchCondition condition = fFactory.createSearchCondition(field, specifier, "hello.mp3");
      List<SearchHit<NewsReference>> result = fModelSearch.searchNews(list(condition), false);
      assertEquals(1, result.size());
View Full Code Here

TOP

Related Classes of org.rssowl.core.persist.SearchSpecifier

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.