Skip to content

Enhancements to Semantic Search Functionality in PyFluent #3906

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

Open
seanpearsonuk opened this issue Apr 8, 2025 · 2 comments
Open

Enhancements to Semantic Search Functionality in PyFluent #3906

seanpearsonuk opened this issue Apr 8, 2025 · 2 comments

Comments

@seanpearsonuk
Copy link
Collaborator

While reviewing the documented examples for PyFluent's semantic search feature (docs), I observed a few areas that could be improved:

  • Search is limited to the entire API tree (pf.search(...)). It would be helpful to support more targeted searches (e.g., within a specific object or sub-tree).
  • Foreign language support appears to rely on translation and string matching. The translated term must still match a meaningful substring within each returned path. This may not be sufficient for truly semantic search and can produce noisy or inconsistent results.
  • Wildcard support must be explicitly enabled via a special argument, rather than being inferred from the query string itself. It’s unclear if this should be necessary—there might be value in supporting inferred wildcards or a more intuitive query syntax.

We may want to test-drive an improved design that better aligns with user expectations, especially around flexibility and internationalization.

@seanpearsonuk
Copy link
Collaborator Author

@mkundu1 for additional comments.

@mkundu1
Copy link
Contributor

mkundu1 commented Apr 8, 2025

For the implementation, we should build a search-index instead of each search() call scanning through all paths. We can start by building a cache of name -> ordered_results map, which would cover string-matching based and wildcard based search. For semantic search, we need to additionally cache the synsets, which we are already doing. The foreign language search can probably be implemented based on these 2 caches.

For reference, here is a user-script for a basic string-matching search for settings API with a cache of name -> ordered_results map.

The caches should be part of the package. Based on their size, we may need to employ some strategy for its packaging.

As we incremnetally implement this, we should write unittests based on some test data (not the actual settings API).

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

No branches or pull requests

2 participants