Home / Function/ _get_indices_infos() — langchain Function Reference

_get_indices_infos() — langchain Function Reference

Architecture documentation for the _get_indices_infos() function in base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  bb96d282_1bc8_a6dc_3a48_1083a4096d66["_get_indices_infos()"]
  daa08d88_1d2b_5650_6257_d688074121b7["ElasticsearchDatabaseChain"]
  bb96d282_1bc8_a6dc_3a48_1083a4096d66 -->|defined in| daa08d88_1d2b_5650_6257_d688074121b7
  16ea3b30_e483_d5fc_b053_6173b3e0b010["_call()"]
  16ea3b30_e483_d5fc_b053_6173b3e0b010 -->|calls| bb96d282_1bc8_a6dc_3a48_1083a4096d66
  style bb96d282_1bc8_a6dc_3a48_1083a4096d66 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/chains/elasticsearch_database/base.py lines 94–110

    def _get_indices_infos(self, indices: list[str]) -> str:
        mappings = self.database.indices.get_mapping(index=",".join(indices))
        if self.sample_documents_in_index_info > 0:
            for k, v in mappings.items():
                hits = self.database.search(
                    index=k,
                    query={"match_all": {}},
                    size=self.sample_documents_in_index_info,
                )["hits"]["hits"]
                hits = [str(hit["_source"]) for hit in hits]
                mappings[k]["mappings"] = str(v) + "\n\n/*\n" + "\n".join(hits) + "\n*/"
        return "\n\n".join(
            [
                "Mapping for index {}:\n{}".format(index, mappings[index]["mappings"])
                for index in mappings
            ],
        )

Subdomains

Called By

Frequently Asked Questions

What does _get_indices_infos() do?
_get_indices_infos() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/chains/elasticsearch_database/base.py.
Where is _get_indices_infos() defined?
_get_indices_infos() is defined in libs/langchain/langchain_classic/chains/elasticsearch_database/base.py at line 94.
What calls _get_indices_infos()?
_get_indices_infos() is called by 1 function(s): _call.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free