Skip to content

ElasticsearchWarning: text_expansion is deprecated. Use sparse_vector instead.Β #42

@kazdam

Description

@kazdam

I'm using elasticsearch 8.15 and ElasticsearchStore which generates the following warnimg. Can you suggest how to mitigate this warning other than ignoring it. Is it ignorable?

venv/lib/python3.11/site-packages/langchain_elasticsearch/vectorstores.py:883: ElasticsearchWarning: text_expansion is deprecated. Use sparse_vector instead.
  hits = self._store.search(

This appears to come from this line of my code:

vector_store.similarity_search_with_score(
            query=question, 
            doc_builder=custom_doc_builder,
            filter=filter,
            k=n_results,
        )

The following are the current package levels.

% pip freeze |grep -E '(langchain|elastic)'
elastic-transport==8.15.0
elasticsearch==8.15.0
langchain==0.2.14
langchain-community==0.2.12
langchain-core==0.2.34
langchain-elasticsearch==0.2.2
langchain-huggingface==0.0.3
langchain-text-splitters==0.2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions