/** * Id equals. * * Restrict search to wikitties that got the id in parameter. * * @param value the id to restrict the results to * @return {@code this} with the {@code ideq} restriction added. */ public Search ideq(String value) { restrictions.add(RestrictionHelper.eq(elt(Element.ELT_ID), value)); return this; }
/** * Extension equals. * * Restrict search to wikitties that got the extension in parameter. * * @param value the extension to restrict the results to * @return {@code this} with the {@code exteq} restriction added. */ public Search exteq(String value) { restrictions.add(RestrictionHelper.eq(elt(Element.ELT_EXTENSION), value)); return this; }
/** * Equals. * * Restrict search so that the field value equals the parameter. * * You might use patterns in your equality. * * @param element the field on which the search is made * @param value the value the element must be equals to * @return {@code this} */ public Search eq(String element, String value) { restrictions.add(RestrictionHelper.eq(elt(element), value)); return this; }
/** * Equals. * * Restrict search so that the field value equals all the members of the * list in parameters. * * @param element the element on which the restriction is put * @param values list of values that the element must be equals to * @return {@code this} with the {@code ideq} restriction added. */ @Deprecated public Search eq(String element, Collection<String> values) { // erreur, car si le search est fait avec un OR au lieu d'un AND // on a pas ce que l'on veut. for (String value : values) { restrictions.add(RestrictionHelper.eq(elt(element), value)); } return this; }
/** * Extension equals. * * Restrict search to wikitties that got all the extensions in parameter. * * @param values list of the extension to restrict the results to * @return {@code this} with the {@code exteq} restriction added. */ public Search exteq(Collection<String> values) { // erreur, car si le search est fait avec un OR au lieu d'un AND // on a pas ce que l'on veut. for (String value : values) { restrictions.add(RestrictionHelper.eq(elt(Element.ELT_EXTENSION), value)); } return this; }
generatedRestriction = RestrictionHelper.rFalse(); } else if ( size == 1 ) { generatedRestriction = RestrictionHelper.eq( associated.getElement(), (String) solrResults.get(0).getFieldValue(WikittySolrConstant.SOLR_ID) ); } else {
String id = SolrUtil.getStringFieldValue( solrResults.get(0), WikittySolrConstant.SOLR_ID); generatedRestriction = RestrictionHelper.eq(associated.getElement(), id); } else { List<String> ids = new ArrayList<String>(solrResults.size());