Skip to content

Commit

Permalink
[OAK-10953] Update default dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
sii62122 committed Aug 22, 2024
1 parent 0c6c244 commit 870f64c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ protected boolean indexSimilarityTag(ElasticDocument doc, PropertyState property
@Override
protected void indexSimilarityBinaries(ElasticDocument doc, PropertyDefinition pd, Blob blob) throws IOException {
// without this check, if the vector size is not correct, the entire document will be skipped
if (pd.getSimilaritySearchDenseVectorSize() == blob.length() / 8) {
if (pd.getSimilaritySearchDenseVectorSize() == blob.length() / 4) {
// see https://www.elastic.co/blog/text-similarity-search-with-vectors-in-elasticsearch
// see https://www.elastic.co/guide/en/elasticsearch/reference/current/dense-vector.html
doc.addSimilarityField(pd.name, blob);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,16 @@
*/
package org.apache.jackrabbit.oak.plugins.index.search;

import javax.jcr.PropertyType;
import static org.apache.jackrabbit.guava.common.collect.ImmutableList.copyOf;
import static org.apache.jackrabbit.guava.common.collect.Iterables.toArray;
import static org.apache.jackrabbit.oak.commons.PathUtils.elements;
import static org.apache.jackrabbit.oak.commons.PathUtils.isAbsolute;
import static org.apache.jackrabbit.oak.plugins.index.search.FulltextIndexConstants.FIELD_BOOST;
import static org.apache.jackrabbit.oak.plugins.index.search.FulltextIndexConstants.PROP_IS_REGEX;
import static org.apache.jackrabbit.oak.plugins.index.search.FulltextIndexConstants.PROP_SIMILARITY_SEARCH_DENSE_VECTOR_SIZE;
import static org.apache.jackrabbit.oak.plugins.index.search.FulltextIndexConstants.PROP_WEIGHT;
import static org.apache.jackrabbit.oak.plugins.index.search.spi.query.FulltextIndexPlanner.DEFAULT_PROPERTY_WEIGHT;
import static org.apache.jackrabbit.oak.plugins.index.search.util.ConfigUtil.getOptionalValue;

import org.apache.jackrabbit.oak.api.PropertyState;
import org.apache.jackrabbit.oak.api.Type;
Expand All @@ -32,16 +41,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import static org.apache.jackrabbit.guava.common.collect.ImmutableList.copyOf;
import static org.apache.jackrabbit.guava.common.collect.Iterables.toArray;
import static org.apache.jackrabbit.oak.commons.PathUtils.elements;
import static org.apache.jackrabbit.oak.commons.PathUtils.isAbsolute;
import static org.apache.jackrabbit.oak.plugins.index.search.FulltextIndexConstants.FIELD_BOOST;
import static org.apache.jackrabbit.oak.plugins.index.search.FulltextIndexConstants.PROP_IS_REGEX;
import static org.apache.jackrabbit.oak.plugins.index.search.FulltextIndexConstants.PROP_WEIGHT;
import static org.apache.jackrabbit.oak.plugins.index.search.FulltextIndexConstants.PROP_SIMILARITY_SEARCH_DENSE_VECTOR_SIZE;
import static org.apache.jackrabbit.oak.plugins.index.search.spi.query.FulltextIndexPlanner.DEFAULT_PROPERTY_WEIGHT;
import static org.apache.jackrabbit.oak.plugins.index.search.util.ConfigUtil.getOptionalValue;
import javax.jcr.PropertyType;

public class PropertyDefinition {
private static final Logger log = LoggerFactory.getLogger(PropertyDefinition.class);
Expand Down

0 comments on commit 870f64c

Please sign in to comment.