Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update text indexing/search on edges #124

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

barakb
Copy link
Contributor

@barakb barakb commented Feb 6, 2025

PR Type

Documentation


Description

  • Added documentation for creating full-text indexes on relation labels.

  • Included examples for utilizing full-text indexes on relations.

  • Documented syntax for deleting full-text indexes on relation labels.


Changes walkthrough 📝

Relevant files
Documentation
indexing.md
Document full-text indexing for relation labels                   

cypher/indexing.md

  • Added section on creating full-text indexes for relation labels.
  • Provided example queries for utilizing full-text indexes on relations.
  • Documented syntax for deleting full-text indexes for relation labels.
  • +25/-0   

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Summary by CodeRabbit

    • New Features

      • Introduced the ability to manage full-text indexes on relationship labels, allowing users to enhance search exploration with new indexing capabilities.
    • Documentation

      • Added detailed instructions on creating, using, and deleting full-text indexes for relationships, providing clear guidance for these new features.

    Copy link
    Contributor

    coderabbitai bot commented Feb 6, 2025

    Walkthrough

    The changes enhance FalkorDB's documentation by adding support for full-text indexing on relationship labels. New sections detail how to create, use, and delete a full-text index for relationships, specifically targeting the Manager label and its name property. The examples include query commands for index management, providing clear syntax for users.

    Changes

    File Change Summary
    cypher/indexing.md Added three sections: "Creating a full-text index for a relation label", "Utilizing a full-text index for a relation label", and "Deleting a full-text index for a relation label" with example commands for managing indexes on relationship properties.

    Sequence Diagram(s)

    sequenceDiagram
        participant U as User
        participant DB as FalkorDB
        U->>DB: Execute "CREATE FULLTEXT INDEX FOR ()-[m:Manager]-() on (m.name)"
        DB-->>U: Acknowledge index creation
        U->>DB: Execute "COPY db.idx.fulltext.queryRelations('Manager', 'Charlie Munger') ..."
        DB-->>U: Return matching relations
        U->>DB: Execute "CALL DROP FULLTEXT INDEX FOR ()-[m:Manager]-() ON (m.name)"
        DB-->>U: Acknowledge index deletion
    
    Loading

    Suggested labels

    Review effort [1-5]: 2

    Suggested reviewers

    • gkorland
    • swilly22

    Poem

    Hopping through code on a bright, clear day,
    I nibble on bugs and chase them away.
    Full-text indexes now dance in the light,
    With Manager labels shining oh so bright.
    Cheers from a rabbit in the land of code!
    🥕🐇

    Tip

    🌐 Web search-backed reviews and chat
    • We have enabled web search-based reviews and chat for all users. This feature allows CodeRabbit to access the latest documentation and information on the web.
    • You can disable this feature by setting web_search: false in the knowledge_base settings.
    • Please share any feedback in the Discord discussion.

    Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

    ❤️ Share
    🪧 Tips

    Chat

    There are 3 ways to chat with CodeRabbit:

    • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
      • I pushed a fix in commit <commit_id>, please review it.
      • Generate unit testing code for this file.
      • Open a follow-up GitHub issue for this discussion.
    • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
      • @coderabbitai generate unit testing code for this file.
      • @coderabbitai modularize this function.
    • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
      • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
      • @coderabbitai read src/utils.ts and generate unit testing code.
      • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
      • @coderabbitai help me debug CodeRabbit configuration file.

    Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

    CodeRabbit Commands (Invoked using PR comments)

    • @coderabbitai pause to pause the reviews on a PR.
    • @coderabbitai resume to resume the paused reviews.
    • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
    • @coderabbitai full review to do a full review from scratch and review all the files again.
    • @coderabbitai summary to regenerate the summary of the PR.
    • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
    • @coderabbitai resolve resolve all the CodeRabbit review comments.
    • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
    • @coderabbitai help to get help.

    Other keywords and placeholders

    • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
    • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
    • Add @coderabbitai anywhere in the PR title to generate the title automatically.

    CodeRabbit Configuration File (.coderabbit.yaml)

    • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
    • Please see the configuration documentation for more information.
    • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

    Documentation and Community

    • Visit our Documentation for detailed information on how to use CodeRabbit.
    • Join our Discord Community to get help, request features, and share feedback.
    • Follow us on X/Twitter for updates and announcements.

    Copy link

    qodo-merge-pro bot commented Feb 6, 2025

    Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here.

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Syntax Error

    The syntax for deleting a full-text index on relations appears incorrect and inconsistent with the node deletion syntax shown above. It should likely use db.idx.fulltext.drop() instead of the current DROP FULLTEXT INDEX syntax.

    GRAPH.QUERY DEMO_GRAPH "CALL DROP FULLTEXT INDEX FOR ()-[m:Manager]-()  ON (m.name)"

    Copy link

    qodo-merge-pro bot commented Feb 6, 2025

    Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here.

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Fix incorrect index drop syntax

    The syntax for dropping a full-text index on relations is incorrect. Use the
    standard db.idx.fulltext.drop() procedure instead.

    cypher/indexing.md [213]

    -GRAPH.QUERY DEMO_GRAPH "CALL DROP FULLTEXT INDEX FOR ()-[m:Manager]-()  ON (m.name)"
    +GRAPH.QUERY DEMO_GRAPH "CALL db.idx.fulltext.drop('Manager')"
    • Apply this suggestion
    Suggestion importance[1-10]: 10

    __

    Why: The suggestion corrects a critical error in the syntax for dropping full-text indexes on relations, aligning it with the standard db.idx.fulltext.drop() procedure used elsewhere in the documentation. This fix is essential for proper functionality.

    High

    Copy link
    Contributor

    @coderabbitai coderabbitai bot left a comment

    Choose a reason for hiding this comment

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

    Actionable comments posted: 0

    🧹 Nitpick comments (2)
    cypher/indexing.md (2)

    191-198: Clarify Full-Text Index Creation for Relation Labels

    The new section for creating a full-text index on relation labels is clear and follows the documentation style used elsewhere in the file. To further enhance the documentation, consider adding a brief note on any additional options or limitations (e.g., supported phonetic configurations) available for relation indexes compared to node indexes. This additional detail could help users understand when and how to use this feature effectively.


    199-207: Ensure Consistency in Full-Text Index Query Usage

    The “Utilizing a full-text index for a relation label” section is consistent in style with the node label querying examples. The command

    "CALL db.idx.fulltext.queryRelations('Manager', 'Charlie Munger') YIELD relation RETURN relation.name"

    is clear and instructive. Consider adding a brief explanatory note on how the query function (queryRelations) differs from the node version (if applicable), or point users to a section with more detailed information on query behavior.

    📜 Review details

    Configuration used: CodeRabbit UI
    Review profile: CHILL
    Plan: Pro

    📥 Commits

    Reviewing files that changed from the base of the PR and between f8db84c and 81e45b2.

    📒 Files selected for processing (1)
    • cypher/indexing.md (1 hunks)
    🔇 Additional comments (1)
    cypher/indexing.md (1)

    208-214: Verify Full-Text Index Deletion Syntax for Relation Labels

    The deletion example is straightforward; however, it introduces a different syntax pattern compared to the node index deletion example (which uses CALL db.idx.fulltext.drop('Movie')). Please verify that the difference—using

    for relations—is intentional and aligns with the product’s command conventions. If the difference is by design due to technical reasons, a small explanatory note might help prevent user confusion. Additionally, consider normalizing spacing (e.g., avoid extra spaces before ON) for clarity.

    @barakb barakb requested review from danshalev7 and gkorland February 6, 2025 08:43
    Copy link
    Contributor

    @danshalev7 danshalev7 left a comment

    Choose a reason for hiding this comment

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

    Some sentence structure and visual suggestions

    @@ -188,6 +188,31 @@ For a node label, the full-text index deletion syntax is:
    GRAPH.QUERY DEMO_GRAPH "CALL db.idx.fulltext.drop('Movie')"
    ```

    ## Creating a full-text index for a relation label
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Full-Text Indexing for Relation Labels

    @@ -188,6 +188,31 @@ For a node label, the full-text index deletion syntax is:
    GRAPH.QUERY DEMO_GRAPH "CALL db.idx.fulltext.drop('Movie')"
    ```

    ## Creating a full-text index for a relation label

    To construct a full-text index on the `name` property with phonetic search of all relations with label `Manager`, use the syntax:
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Creating a Full-Text Index

    To create a full-text index on the name property of all relations with the label Manager and enable phonetic search, use the following synax:

    ## Creating a full-text index for a relation label

    To construct a full-text index on the `name` property with phonetic search of all relations with label `Manager`, use the syntax:

    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Querying with a Full-Text Index

    To search for specific words within the indexed relations, use:

    "CALL db.idx.fulltext.queryRelations('Manager', 'Charlie Munger') YIELD relation RETURN relation.name"
    ```

    ## Deleting a full-text index for a relation label
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Deleting a Full-Text Index

    To delete the full-text index for a specific relation label, use:

    ```sh
    GRAPH.QUERY DEMO_GRAPH "CALL DROP FULLTEXT INDEX FOR ()-[m:Manager]-() ON (m.name)"
    ```

    # Vector indexing
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Vector Indexing

    ```sh
    GRAPH.QUERY DEMO_GRAPH "CALL DROP FULLTEXT INDEX FOR ()-[m:Manager]-() ON (m.name)"
    ```

    # Vector indexing

    With the introduction of the `vector` data-type a new type of index was introduced.
    Copy link
    Contributor

    Choose a reason for hiding this comment

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

    Creating a Vector Index

    To create a vector index, follow this syntax (example provided for a vector property embedding on nodes with label Document):

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants