Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Fix docs: query index #886

Closed
wants to merge 1 commit into from
Closed

Fix docs: query index #886

wants to merge 1 commit into from

Conversation

MarouaneMaatouk
Copy link
Contributor

Description

In this PR, there's a fix for documentation about querying indices:

index = VectorStoreIndex.from_documents(documents)
index.query(question)

which should be:

index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine()
query_engine.query(question)

Fixes #874

Type of Change

Please delete options that are not relevant.

  • New Loader/Tool
  • Bug fix / Smaller change
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Added new unit/integration tests
  • Added new notebook (that tests end-to-end)
  • I stared at the code and made sure it makes sense

Suggested Checklist:

  • I have added a library.json file if a new loader/tool was added
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I ran make format; make lint to appease the lint gods

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Collaborator

@anoopshrma anoopshrma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great @MarouaneMaatouk . Thank you for the contribution!!

@MarouaneMaatouk MarouaneMaatouk closed this by deleting the head repository Jan 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AttributeError: 'VectorStoreIndex' object has no attribute 'query'
2 participants