nidx-binding 6.3.3.post92__tar.gz → 6.3.3.post96__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/PKG-INFO +1 -1
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_protos/pyproject.toml +1 -1
- nidx_binding-6.3.3.post96/nidx_relation/src/graph_collector.rs +226 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_relation/src/graph_query_parser.rs +109 -6
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_relation/src/lib.rs +1 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_relation/src/reader.rs +98 -22
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/pyproject.toml +1 -1
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/tests/test_search_relations.rs +190 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-0cfce9b29547f8f5bafa6e440f86103be7b8c4ad2fd92db9ac223f4efbe23d10.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-1a561eed00f3dbe868bf5030059793300209179dc8fb73e4b57a54b5e81262fe.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-1d3fca2682e25a01143da92285297f134a6a105a96f64d87e0db3abb219855e4.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-249b3b57c27a71baa823f1fe0f0bba9c9af36f61c28f731e58beea60ec48e687.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-24cb6b683daa42d7125f862e25943ab4be7bf275cd8739f8da4859d701795e1a.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-263c8fce6db5b03bbd012fafdba6943cbee6ed7eb8976cdef4f5b01dde7ca6fd.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-2a5d92fb1638df830a4477a7cdf24e6db6b43034b7bbe74fdfb63e8afe2c4071.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-2b065a363f58caed60e3706603c1260dbf5a4c795604a5b68edda22eb07fec1b.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-3fc3cb39934683de8cd475ce1368c8373453eb1e01f81587d66b9d14b109ce6e.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-48f33b77b7c1633467b0b2efcaa1d3c207e7757e4f1d83b40d15e6ca365f7771.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-4ae09f2c08e2f324bee01bb8487a8f37678a1c5e9d327339235c50d4921a8949.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-4d7a76fa413c9ef0ce2a47ac7bb7e01d3e6a2aabded9487d21010a53efee8852.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-4fcbdd6657c7dc9b60b3a563dd41711b3dbcf72ce063427b7a01f8cddf34c244.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-577109ac00ccfbd38ecaccab94116f2f46a4caf5612afa372cded197123c1e08.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-5db25f97d8578d6d78f2f6bd4b72cc82a9b1b82805c6422d967ac63b20d99db4.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-5ec3233a3a23e926055056d46bdde17836a633066dbb5f349502648cd3ea9a60.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-66edb6ea424d8681927dcddb6bac5f1239175f4775d1f40417ba15054b0c6f19.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-6f9c6d201c1b5712efb68c363bffd3e0169c11f2a8f925e8cd4e8808599ff7b4.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-733c3ebacc86f444bf5e2dd79ade660c291e88a00fc09b722f6e2e191545874c.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-77a245aed9f6f8b9fc643efbd4b1e2e8e99bbba085e3e75a4f29321cd7b2a25c.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-7a3bf27c330c468a596e8a297cf7d8b192e31e67ecc5177c1267f579e8e247c7.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-7a7e59e47b30b12237511fd3d7da2d17b0471ad2b006af48d6a6f587c779692b.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-7dcbb33312cc9f11ae3a6d73b1ace017a9f19a8bf8f10304fc57977c8efeadff.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-7efa7c0d747afc4b6aed0586ff846c27839c3213ff7ee9f30c89b0d0f17e60e3.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-8493140d788604d498a4e48da4158708572ccc9d60185290a00d549cc84533db.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-8493bb0059b013eaca42fd10cd7d04f0d06a8acaed379eff0d23f3229edde9ee.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-87996b3d6c7a2195438d7038015b06949102bce8c7b8cd8db1f83aaf23cbe489.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-8f096d8171b89f9615d18f95d696dc9e4fb3674e103161a713cdc806f7a68506.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-917732a56ee04bf3a6e127319dda8225210869c82f9828d878162394dba4e078.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-95fe4ef93ee90733db1b67ed7987f80b5aac792f1590b979c68b418d1599eb98.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-9b67658569b343d8b4b61ae0a7dc721f367f2ba33c7b69b9e68bfd5c9bff5206.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-9c8062ea55d070afef68309e58fa987eb37fda44e1efbf68c8ba2af7846cc968.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-a06e1d9f6f95e4c4c2b98310ebddcc9d963cc033582bf2e945e8bf3a301b4247.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-a55265c9b07bd1399961a6f1e757201fd0eebe868ddaf96437111113d80fce92.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-a891a37be5c2d7cce775c2dd33726b0318fd3839beab222a1b22bc6174604207.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-a945191bb4b3e37d6823ed3ad499339d007d69983105de8567777d9daf517b28.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-abe9f7832f2bd799ac44008da031e8d8ab52d4f5fbfc2a7e3974e8873bae55b2.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-aca588cca57a85e4d7fcc40c23cd87e57d53d11ca550d78e7e3d5e39e524fcd3.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-b02f8aafc00a7724510772ac41269e368c5bccf03ef7b4590e0ef6fd1a1bf64f.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-b742e17cabe2d64617e9aa64bafc782172f7a4f8023d1b54f952a0fb39f6b2b8.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-b94e349dbc0daec57f8f8f6e9e2dffb06100b1bb2b41d297c9f3b191da37a83d.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-bd9afa22994aba671dbf7b5f89b53c2ee02f53c0442a81265786a6d52d08512f.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-be60554eca98a5899efc6b49785cecd6444a6d39afed9e4a884ce2dbf162012c.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-bf49702b506c9a1650ece1f8e8d9f14834a902f8caefafe30ded55e2790f2188.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-bfb8ae2e860e451b0868a7b1b50a451d998b2105f9fdfd307b26a1775d145e9f.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-bfcd21ed704cd305db5c17fcdec7d92aa4ac501913c9c9514d8ff92928c0c7e7.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-c3ab694650f49a75b146fb877a92e48c4f20f0d99f70f8ec859fbb763b01a1e5.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-c55542bb9fae544d87fae6f30e0fe8a9088d12075f4442ab4fe2fcd05e472234.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-cb29a6556d35ac630ee0aa885dd7341cf9573bd3efd216ff8a887b87686b03db.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-d0a1f341a89f5f14696b10baa72db9d95551c2b7e5fc67308fd52dc03dd98a92.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-d2ad0a0ca2649c9e4873cfcc1fc66d2d07cc45d0f65c560b06d7b5f592f4fa8a.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-d6cfe78eb635ba0b89ca4021a4dc8182d18ab5b197f30149cd28488eba4c1df5.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-d729b56dea00e49dcdba8cf0001e2811da27351eabe98212db3b589f18fc6f32.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-d9658bfd4e7170b41d03f2ddf2446d0bf54171c0d39d53bf20af2b8437f2ec48.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-dbba7b3d3289425bae711aedbf73fbc3699f857f86f84d95c3b556d05c5658b0.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-dcb96b649d6d63a58efd5d445453a4f3d7869a56ff714b69bedf3d616a0473ca.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-ebd876fbf5362a5900e75bc05f2f11c73c406ef7da4e95097fc6a1c3d1b8bc54.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-eef5cc6bce1cc14eba8f3e68971724ef181e88cffcedd74673615f2026b89a62.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/.sqlx/query-ef56d5fefc5774040d1ee397beadb475f6af02768c22f0e583c74062e2e821ce.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/Cargo.lock +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/Cargo.toml +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/README.md +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/migrations/20241007163501_initial.sql +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/migrations/20241211120039_merge_job_priority.sql +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/migrations/20241211121159_basic_indexes.sql +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/migrations/20241212151105_check_segment_records.sql +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/migrations/20250110145554_in_flight_messages.sql +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_binding/Cargo.toml +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_binding/src/lib.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/Cargo.toml +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/src/fuzzy_query.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/src/lib.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/src/query_io.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/src/reader.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/src/request_types.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/src/resource_indexer.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/src/schema.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/src/search_query.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/src/search_response.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/src/set_query.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/src/stop_words.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/README.md +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/ar.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/az.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/bn.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/ca.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/ch.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/da.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/de.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/el.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/en.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/es.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/eu.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/extract.py +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/fi.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/fr.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/he.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/hu.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/id.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/it.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/kk.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/ne.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/nl.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/no.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/pt.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/ro.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/ru.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/sl.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/sv.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/tg.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/stop_words/tr.json +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/tests/common/mod.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_paragraph/tests/reader.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_protos/Cargo.toml +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_protos/build.py +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_protos/build.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_protos/src/lib.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_protos/src/nidx.proto +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_relation/Cargo.toml +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_relation/src/io_maps.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_relation/src/resource_indexer.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_relation/src/schema.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_relation/tests/common/mod.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_relation/tests/test_graph_search.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_relation/tests/test_reader.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_relation/tests/test_writer.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_tantivy/Cargo.toml +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_tantivy/src/index_reader.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_tantivy/src/lib.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_tests/Cargo.toml +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_tests/src/graph.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_tests/src/lib.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_text/Cargo.toml +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_text/src/lib.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_text/src/prefilter.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_text/src/query_io.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_text/src/reader.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_text/src/request_types.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_text/src/resource_indexer.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_text/src/schema.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_text/src/search_query.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_text/tests/common/mod.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_text/tests/test_flow.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_text/tests/test_search.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_text/tests/test_streaming.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_types/Cargo.toml +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_types/src/lib.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_types/src/prefilter.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_types/src/query_language.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/Cargo.toml +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/config.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/data_point/disk_hnsw.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/data_point/mod.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/data_point/node.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/data_point/ops_hnsw.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/data_point/params.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/data_point/ram_hnsw.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/data_point/tests.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/data_point_provider/mod.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/data_point_provider/reader.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/data_types/data_store.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/data_types/mod.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/data_types/trie.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/data_types/trie_ram.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/formula/mod.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/indexer.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/inverted_index/fst_index.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/inverted_index/map.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/inverted_index.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/lib.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/query_io.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/request_types.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/utils.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/vector_types/dense_f32.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/src/vector_types/mod.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/tests/common/mod.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/tests/test_basic_search.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_vector/tests/test_hidden.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/api/grpc.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/api/shards.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/api.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/control.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/errors.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/grpc_server.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/import_export.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/indexer.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/lib.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/main.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/metadata/deletion.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/metadata/index.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/metadata/index_request.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/metadata/merge_job.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/metadata/segment.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/metadata/shard.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/metadata.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/metrics.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/scheduler/audit_task.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/scheduler/log_merge.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/scheduler/merge_task.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/scheduler/metrics_task.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/scheduler/purge_tasks.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/scheduler/vector_merge.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/scheduler.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/searcher/grpc.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/searcher/index_cache.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/searcher/query_language.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/searcher/query_planner.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/searcher/shard_search.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/searcher/shard_selector.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/searcher/shard_suggest.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/searcher/streams.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/searcher/sync.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/searcher.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/segment_store.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/settings.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/telemetry/duration_layer.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/telemetry/log_format.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/telemetry/middleware.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/telemetry.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/tool.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/src/worker.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/tests/common/mod.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/tests/common/services.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/tests/test_date_range_search.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/tests/test_search_filtering.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/tests/test_search_sorting.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/tests/test_searcher_cluster.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/tests/test_security_search.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/tests/test_shards.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/tests/test_shards_api.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/tests/test_suggest.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/tests/test_synced_searcher.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/tests/test_vector_normalization.rs +0 -0
- {nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/tests/test_vectorsets.rs +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: nidx_binding
|
3
|
-
Version: 6.3.3.
|
3
|
+
Version: 6.3.3.post96
|
4
4
|
Classifier: Programming Language :: Rust
|
5
5
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
6
6
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
@@ -4,7 +4,7 @@ build-backend = "pdm.backend"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "nidx_protos"
|
7
|
-
version = "6.3.3.
|
7
|
+
version = "6.3.3.post96"
|
8
8
|
license = { text = "AGPL" }
|
9
9
|
description = "Protobuf definitions for nucliadb/nidx"
|
10
10
|
authors = [ { name = "Nuclia", email = "nucliadb@nuclia.com" }]
|
@@ -0,0 +1,226 @@
|
|
1
|
+
// Copyright (C) 2021 Bosutech XXI S.L.
|
2
|
+
//
|
3
|
+
// nucliadb is offered under the AGPL v3.0 and as commercial software.
|
4
|
+
// For commercial licensing, contact us at info@nuclia.com.
|
5
|
+
//
|
6
|
+
// AGPL:
|
7
|
+
// This program is free software: you can redistribute it and/or modify
|
8
|
+
// it under the terms of the GNU Affero General Public License as
|
9
|
+
// published by the Free Software Foundation, either version 3 of the
|
10
|
+
// License, or (at your option) any later version.
|
11
|
+
//
|
12
|
+
// This program is distributed in the hope that it will be useful,
|
13
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
// GNU Affero General Public License for more details.
|
16
|
+
//
|
17
|
+
// You should have received a copy of the GNU Affero General Public License
|
18
|
+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
|
+
//
|
20
|
+
|
21
|
+
use std::collections::{HashMap, HashSet};
|
22
|
+
|
23
|
+
use tantivy::{
|
24
|
+
DocId, Score, SegmentOrdinal, SegmentReader, TantivyDocument,
|
25
|
+
collector::{Collector, SegmentCollector},
|
26
|
+
store::StoreReader,
|
27
|
+
};
|
28
|
+
use tracing::warn;
|
29
|
+
|
30
|
+
use crate::io_maps;
|
31
|
+
|
32
|
+
// XXX: this is a completely arbitrary number. Feel free to change for a more adequate value
|
33
|
+
const STORE_READER_CACHED_BLOCKS: usize = 10;
|
34
|
+
|
35
|
+
pub type NodeId = (String, i32, String);
|
36
|
+
pub type RelationId = (String, u64);
|
37
|
+
|
38
|
+
#[derive(Clone, Copy)]
|
39
|
+
pub enum NodeSelector {
|
40
|
+
SourceNodes,
|
41
|
+
DestinationNodes,
|
42
|
+
}
|
43
|
+
|
44
|
+
pub struct TopUniqueNodeCollector {
|
45
|
+
limit: usize,
|
46
|
+
selector: NodeSelector,
|
47
|
+
schema: crate::schema::Schema,
|
48
|
+
}
|
49
|
+
|
50
|
+
pub struct TopUniqueRelationCollector {
|
51
|
+
limit: usize,
|
52
|
+
schema: crate::schema::Schema,
|
53
|
+
}
|
54
|
+
|
55
|
+
pub struct TopUniqueNodeSegmentCollector {
|
56
|
+
limit: usize,
|
57
|
+
selector: NodeSelector,
|
58
|
+
unique: HashSet<NodeId>,
|
59
|
+
schema: crate::schema::Schema,
|
60
|
+
store_reader: StoreReader,
|
61
|
+
}
|
62
|
+
|
63
|
+
pub struct TopUniqueRelationSegmentCollector {
|
64
|
+
limit: usize,
|
65
|
+
unique: HashMap<RelationId, TantivyDocument>,
|
66
|
+
schema: crate::schema::Schema,
|
67
|
+
store_reader: StoreReader,
|
68
|
+
}
|
69
|
+
|
70
|
+
impl TopUniqueNodeCollector {
|
71
|
+
pub fn new(selector: NodeSelector, limit: usize) -> Self {
|
72
|
+
Self {
|
73
|
+
limit,
|
74
|
+
selector,
|
75
|
+
schema: crate::schema::Schema::new(),
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
impl TopUniqueRelationCollector {
|
81
|
+
pub fn new(limit: usize) -> Self {
|
82
|
+
Self {
|
83
|
+
limit,
|
84
|
+
schema: crate::schema::Schema::new(),
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
impl Collector for TopUniqueNodeCollector {
|
90
|
+
type Fruit = HashSet<NodeId>;
|
91
|
+
type Child = TopUniqueNodeSegmentCollector;
|
92
|
+
|
93
|
+
fn requires_scoring(&self) -> bool {
|
94
|
+
false
|
95
|
+
}
|
96
|
+
|
97
|
+
fn for_segment(&self, _segment_local_id: SegmentOrdinal, segment: &SegmentReader) -> tantivy::Result<Self::Child> {
|
98
|
+
Ok(TopUniqueNodeSegmentCollector {
|
99
|
+
limit: self.limit,
|
100
|
+
selector: self.selector,
|
101
|
+
unique: HashSet::new(),
|
102
|
+
store_reader: segment.get_store_reader(STORE_READER_CACHED_BLOCKS)?,
|
103
|
+
schema: self.schema.clone(),
|
104
|
+
})
|
105
|
+
}
|
106
|
+
|
107
|
+
fn merge_fruits(
|
108
|
+
&self,
|
109
|
+
segment_fruits: Vec<<Self::Child as SegmentCollector>::Fruit>,
|
110
|
+
) -> tantivy::Result<Self::Fruit> {
|
111
|
+
let mut unique = HashSet::new();
|
112
|
+
let mut fruits = segment_fruits.into_iter().flatten();
|
113
|
+
let mut fruit = fruits.next();
|
114
|
+
|
115
|
+
while fruit.is_some() && unique.len() < self.limit {
|
116
|
+
unique.insert(fruit.unwrap());
|
117
|
+
fruit = fruits.next();
|
118
|
+
}
|
119
|
+
Ok(unique)
|
120
|
+
}
|
121
|
+
}
|
122
|
+
|
123
|
+
impl Collector for TopUniqueRelationCollector {
|
124
|
+
type Fruit = Vec<TantivyDocument>;
|
125
|
+
type Child = TopUniqueRelationSegmentCollector;
|
126
|
+
|
127
|
+
fn requires_scoring(&self) -> bool {
|
128
|
+
false
|
129
|
+
}
|
130
|
+
|
131
|
+
fn for_segment(&self, _segment_local_id: SegmentOrdinal, segment: &SegmentReader) -> tantivy::Result<Self::Child> {
|
132
|
+
Ok(TopUniqueRelationSegmentCollector {
|
133
|
+
limit: self.limit,
|
134
|
+
unique: HashMap::new(),
|
135
|
+
store_reader: segment.get_store_reader(STORE_READER_CACHED_BLOCKS)?,
|
136
|
+
schema: self.schema.clone(),
|
137
|
+
})
|
138
|
+
}
|
139
|
+
|
140
|
+
fn merge_fruits(
|
141
|
+
&self,
|
142
|
+
segment_fruits: Vec<<Self::Child as SegmentCollector>::Fruit>,
|
143
|
+
) -> tantivy::Result<Self::Fruit> {
|
144
|
+
let mut unique = HashSet::new();
|
145
|
+
let mut docs = Vec::new();
|
146
|
+
let mut fruits = segment_fruits.into_iter().flatten();
|
147
|
+
let mut fruit = fruits.next();
|
148
|
+
|
149
|
+
while fruit.is_some() && unique.len() < self.limit {
|
150
|
+
let (relation_id, doc) = fruit.unwrap();
|
151
|
+
if unique.insert(relation_id) {
|
152
|
+
docs.push(doc);
|
153
|
+
}
|
154
|
+
fruit = fruits.next();
|
155
|
+
}
|
156
|
+
Ok(docs)
|
157
|
+
}
|
158
|
+
}
|
159
|
+
|
160
|
+
impl SegmentCollector for TopUniqueNodeSegmentCollector {
|
161
|
+
type Fruit = HashSet<NodeId>;
|
162
|
+
|
163
|
+
fn collect(&mut self, doc_id: DocId, _score: Score) {
|
164
|
+
// we already have all unique results we need
|
165
|
+
if self.unique.len() >= self.limit {
|
166
|
+
return;
|
167
|
+
}
|
168
|
+
|
169
|
+
// log and skip documents not in the store. This should not happen
|
170
|
+
let doc = match self.store_reader.get::<TantivyDocument>(doc_id) {
|
171
|
+
Ok(doc) => doc,
|
172
|
+
Err(error) => {
|
173
|
+
warn!("Error while getting document from store: {error:?}");
|
174
|
+
return;
|
175
|
+
}
|
176
|
+
};
|
177
|
+
|
178
|
+
let node = match self.selector {
|
179
|
+
NodeSelector::SourceNodes => {
|
180
|
+
let source_value = self.schema.source_value(&doc).to_string();
|
181
|
+
let source_type = io_maps::u64_to_node_type::<i32>(self.schema.source_type(&doc));
|
182
|
+
let source_subtype = self.schema.source_subtype(&doc).to_string();
|
183
|
+
(source_value, source_type, source_subtype)
|
184
|
+
}
|
185
|
+
NodeSelector::DestinationNodes => {
|
186
|
+
let destination_value = self.schema.target_value(&doc).to_string();
|
187
|
+
let destination_type = io_maps::u64_to_node_type::<i32>(self.schema.target_type(&doc));
|
188
|
+
let destination_subtype = self.schema.target_subtype(&doc).to_string();
|
189
|
+
(destination_value, destination_type, destination_subtype)
|
190
|
+
}
|
191
|
+
};
|
192
|
+
self.unique.insert(node);
|
193
|
+
}
|
194
|
+
|
195
|
+
fn harvest(self) -> Self::Fruit {
|
196
|
+
self.unique
|
197
|
+
}
|
198
|
+
}
|
199
|
+
|
200
|
+
impl SegmentCollector for TopUniqueRelationSegmentCollector {
|
201
|
+
type Fruit = HashMap<RelationId, TantivyDocument>;
|
202
|
+
|
203
|
+
fn collect(&mut self, doc_id: DocId, _score: Score) {
|
204
|
+
// we already have all unique results we need
|
205
|
+
if self.unique.len() >= self.limit {
|
206
|
+
return;
|
207
|
+
}
|
208
|
+
|
209
|
+
// log and skip documents not in the store. This should not happen
|
210
|
+
let doc = match self.store_reader.get::<TantivyDocument>(doc_id) {
|
211
|
+
Ok(doc) => doc,
|
212
|
+
Err(error) => {
|
213
|
+
warn!("Error while getting document from store: {error:?}");
|
214
|
+
return;
|
215
|
+
}
|
216
|
+
};
|
217
|
+
|
218
|
+
let relation_label = self.schema.relationship_label(&doc).to_string();
|
219
|
+
let relation_type = self.schema.relationship(&doc);
|
220
|
+
self.unique.insert((relation_label, relation_type), doc);
|
221
|
+
}
|
222
|
+
|
223
|
+
fn harvest(self) -> Self::Fruit {
|
224
|
+
self.unique
|
225
|
+
}
|
226
|
+
}
|
{nidx_binding-6.3.3.post92 → nidx_binding-6.3.3.post96}/nidx_relation/src/graph_query_parser.rs
RENAMED
@@ -17,6 +17,7 @@
|
|
17
17
|
// You should have received a copy of the GNU Affero General Public License
|
18
18
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19
19
|
//
|
20
|
+
use anyhow::anyhow;
|
20
21
|
use nidx_protos::relation_node::NodeType;
|
21
22
|
use nidx_types::query_language::{BooleanExpression, BooleanOperation, Operator};
|
22
23
|
use tantivy::query::{AllQuery, BooleanQuery, FuzzyTermQuery, Occur, Query, TermQuery};
|
@@ -107,6 +108,13 @@ pub enum GraphQuery {
|
|
107
108
|
PathQuery(PathQuery),
|
108
109
|
}
|
109
110
|
|
111
|
+
#[derive(Clone, Copy)]
|
112
|
+
enum NodePosition {
|
113
|
+
Source,
|
114
|
+
Destination,
|
115
|
+
}
|
116
|
+
|
117
|
+
pub struct BoolNodeQuery(BooleanExpression<Node>);
|
110
118
|
pub struct BoolGraphQuery(BooleanExpression<GraphQuery>);
|
111
119
|
|
112
120
|
#[derive(Clone, Copy)]
|
@@ -152,6 +160,43 @@ impl GraphQueryParser {
|
|
152
160
|
}
|
153
161
|
}
|
154
162
|
|
163
|
+
pub fn parse_bool_node(&self, query: BoolNodeQuery) -> (Box<dyn Query>, Box<dyn Query>) {
|
164
|
+
(
|
165
|
+
self.inner_parse_bool_node(query.0.clone(), NodePosition::Source),
|
166
|
+
self.inner_parse_bool_node(query.0, NodePosition::Destination),
|
167
|
+
)
|
168
|
+
}
|
169
|
+
|
170
|
+
fn inner_parse_bool_node(&self, query: BooleanExpression<Node>, position: NodePosition) -> Box<dyn Query> {
|
171
|
+
match query {
|
172
|
+
BooleanExpression::Literal(node) => match position {
|
173
|
+
NodePosition::Source => {
|
174
|
+
self.parse(GraphQuery::NodeQuery(NodeQuery::SourceNode(Expression::Value(node))))
|
175
|
+
}
|
176
|
+
NodePosition::Destination => self.parse(GraphQuery::NodeQuery(NodeQuery::DestinationNode(
|
177
|
+
Expression::Value(node),
|
178
|
+
))),
|
179
|
+
},
|
180
|
+
BooleanExpression::Not(subquery) => {
|
181
|
+
let mut subqueries = vec![];
|
182
|
+
subqueries.push((Occur::Must, Box::new(AllQuery) as Box<dyn Query>));
|
183
|
+
subqueries.push((Occur::MustNot, self.inner_parse_bool_node(*subquery, position)));
|
184
|
+
Box::new(BooleanQuery::new(subqueries))
|
185
|
+
}
|
186
|
+
BooleanExpression::Operation(operation) => {
|
187
|
+
let mut subqueries = vec![];
|
188
|
+
let occur = match operation.operator {
|
189
|
+
Operator::And => Occur::Must,
|
190
|
+
Operator::Or => Occur::Should,
|
191
|
+
};
|
192
|
+
for expression in operation.operands {
|
193
|
+
subqueries.push((occur, self.inner_parse_bool_node(expression, position)));
|
194
|
+
}
|
195
|
+
Box::new(BooleanQuery::new(subqueries))
|
196
|
+
}
|
197
|
+
}
|
198
|
+
}
|
199
|
+
|
155
200
|
pub fn parse(&self, query: GraphQuery) -> Box<dyn Query> {
|
156
201
|
// REVIEW: if at some point we only want to return what the query really asks (nodes,
|
157
202
|
// relations or paths), we may want to return the query and some kind of response builder
|
@@ -200,7 +245,7 @@ impl GraphQueryParser {
|
|
200
245
|
let mut subqueries = vec![];
|
201
246
|
|
202
247
|
subqueries.extend(self.has_node_expression_as_source(&source_expression));
|
203
|
-
subqueries.extend(self.has_relation(relation_expression).into_iter());
|
248
|
+
subqueries.extend(self.has_relation(&relation_expression).into_iter());
|
204
249
|
subqueries.extend(self.has_node_expression_as_destination(&destination_expression));
|
205
250
|
|
206
251
|
// Due to implementation details on tantivy, a query containing only MustNot won't
|
@@ -344,29 +389,29 @@ impl GraphQueryParser {
|
|
344
389
|
}
|
345
390
|
|
346
391
|
// Return a list of queries needed to match a triplet containing such relation expression
|
347
|
-
fn has_relation(&self, expression: Expression<Relation>) -> Vec<(Occur, Box<dyn Query>)> {
|
392
|
+
fn has_relation(&self, expression: &Expression<Relation>) -> Vec<(Occur, Box<dyn Query>)> {
|
348
393
|
let mut subqueries = vec![];
|
349
394
|
|
350
395
|
match expression {
|
351
396
|
Expression::Value(Relation { value: None }) => {}
|
352
397
|
Expression::Value(Relation { value: Some(value) }) if value.is_empty() => {}
|
353
398
|
Expression::Value(Relation { value: Some(value) }) => {
|
354
|
-
subqueries.push((Occur::Must, self.has_relation_label(
|
399
|
+
subqueries.push((Occur::Must, self.has_relation_label(value)));
|
355
400
|
}
|
356
401
|
|
357
402
|
Expression::Not(Relation { value: None }) => {}
|
358
403
|
Expression::Not(Relation { value: Some(value) }) if value.is_empty() => {}
|
359
404
|
Expression::Not(Relation { value: Some(value) }) => {
|
360
|
-
subqueries.push((Occur::MustNot, self.has_relation_label(
|
405
|
+
subqueries.push((Occur::MustNot, self.has_relation_label(value)));
|
361
406
|
}
|
362
407
|
|
363
408
|
Expression::Or(relations) => {
|
364
409
|
subqueries.extend(relations.into_iter().flat_map(|relation| {
|
365
|
-
if let Some(label) = relation.value {
|
410
|
+
if let Some(label) = &relation.value {
|
366
411
|
if label.is_empty() {
|
367
412
|
None
|
368
413
|
} else {
|
369
|
-
Some((Occur::Should, self.has_relation_label(
|
414
|
+
Some((Occur::Should, self.has_relation_label(label)))
|
370
415
|
}
|
371
416
|
} else {
|
372
417
|
None
|
@@ -456,6 +501,64 @@ impl From<&str> for Term {
|
|
456
501
|
}
|
457
502
|
}
|
458
503
|
|
504
|
+
impl TryFrom<&nidx_protos::graph_query::PathQuery> for BoolNodeQuery {
|
505
|
+
type Error = anyhow::Error;
|
506
|
+
|
507
|
+
fn try_from(value: &nidx_protos::graph_query::PathQuery) -> Result<Self, Self::Error> {
|
508
|
+
let bool_expr = match &value.query {
|
509
|
+
Some(query) => match query {
|
510
|
+
nidx_protos::graph_query::path_query::Query::Path(path) => {
|
511
|
+
if !(path.source.is_some()
|
512
|
+
&& path.relation.is_none()
|
513
|
+
&& path.destination.is_none()
|
514
|
+
&& path.undirected == true)
|
515
|
+
{
|
516
|
+
// We are doing something wrong between search API and nidx
|
517
|
+
return Err(anyhow!(
|
518
|
+
"Invalid node query, we only expect a source for an undirected path! {path:?}"
|
519
|
+
));
|
520
|
+
}
|
521
|
+
|
522
|
+
let pb_node = path.source.as_ref().unwrap();
|
523
|
+
let node = Node::try_from(pb_node)?;
|
524
|
+
BooleanExpression::Literal(node)
|
525
|
+
}
|
526
|
+
|
527
|
+
nidx_protos::graph_query::path_query::Query::BoolNot(bool_not) => {
|
528
|
+
let subquery = BoolNodeQuery::try_from(bool_not.as_ref())?.0;
|
529
|
+
BooleanExpression::Not(Box::new(subquery))
|
530
|
+
}
|
531
|
+
|
532
|
+
nidx_protos::graph_query::path_query::Query::BoolAnd(bool_and) => {
|
533
|
+
BooleanExpression::Operation(BooleanOperation {
|
534
|
+
operator: Operator::And,
|
535
|
+
operands: bool_and
|
536
|
+
.operands
|
537
|
+
.iter()
|
538
|
+
.map(|o| BoolNodeQuery::try_from(o).map(|x| x.0))
|
539
|
+
.collect::<anyhow::Result<Vec<_>>>()?,
|
540
|
+
})
|
541
|
+
}
|
542
|
+
|
543
|
+
nidx_protos::graph_query::path_query::Query::BoolOr(bool_or) => {
|
544
|
+
BooleanExpression::Operation(BooleanOperation {
|
545
|
+
operator: Operator::Or,
|
546
|
+
operands: bool_or
|
547
|
+
.operands
|
548
|
+
.iter()
|
549
|
+
.map(|o| BoolNodeQuery::try_from(o).map(|x| x.0))
|
550
|
+
.collect::<anyhow::Result<Vec<_>>>()?,
|
551
|
+
})
|
552
|
+
}
|
553
|
+
},
|
554
|
+
|
555
|
+
None => BooleanExpression::Literal(Node::default()),
|
556
|
+
};
|
557
|
+
|
558
|
+
Ok(BoolNodeQuery(bool_expr))
|
559
|
+
}
|
560
|
+
}
|
561
|
+
|
459
562
|
impl TryFrom<&nidx_protos::graph_query::PathQuery> for BoolGraphQuery {
|
460
563
|
type Error = anyhow::Error;
|
461
564
|
|
@@ -21,6 +21,7 @@ use std::collections::HashSet;
|
|
21
21
|
use std::fmt::Debug;
|
22
22
|
use std::path::Path;
|
23
23
|
|
24
|
+
use nidx_protos::graph_search_request::QueryKind;
|
24
25
|
use nidx_protos::relation_prefix_search_request::Search;
|
25
26
|
use nidx_protos::{
|
26
27
|
EntitiesSubgraphResponse, GraphSearchRequest, GraphSearchResponse, RelationNode, RelationPrefixSearchResponse,
|
@@ -30,8 +31,9 @@ use tantivy::collector::TopDocs;
|
|
30
31
|
use tantivy::query::{BooleanQuery, Occur, Query};
|
31
32
|
use tantivy::{DocAddress, Index, IndexReader, Searcher};
|
32
33
|
|
34
|
+
use crate::graph_collector::{NodeSelector, TopUniqueNodeCollector, TopUniqueRelationCollector};
|
33
35
|
use crate::graph_query_parser::{
|
34
|
-
BoolGraphQuery, Expression, FuzzyTerm, GraphQuery, GraphQueryParser, Node, NodeQuery, Term,
|
36
|
+
BoolGraphQuery, BoolNodeQuery, Expression, FuzzyTerm, GraphQuery, GraphQueryParser, Node, NodeQuery, Term,
|
35
37
|
};
|
36
38
|
use crate::schema::Schema;
|
37
39
|
use crate::{io_maps, schema};
|
@@ -75,13 +77,22 @@ impl RelationsReaderService {
|
|
75
77
|
return Ok(GraphSearchResponse::default());
|
76
78
|
};
|
77
79
|
|
78
|
-
|
79
|
-
|
80
|
+
let top_k = request.top_k as usize;
|
81
|
+
|
82
|
+
let response = match request.kind() {
|
83
|
+
QueryKind::Path => self.paths_graph_search(query, top_k),
|
84
|
+
QueryKind::Nodes => self.nodes_graph_search(query, top_k),
|
85
|
+
QueryKind::Relations => self.relations_graph_search(query, top_k),
|
86
|
+
};
|
87
|
+
response
|
88
|
+
}
|
89
|
+
|
90
|
+
pub fn inner_graph_search(&self, query: GraphQuery) -> anyhow::Result<nidx_protos::GraphSearchResponse> {
|
80
91
|
let parser = GraphQueryParser::new();
|
81
|
-
let index_query = parser.
|
92
|
+
let index_query: Box<dyn Query> = parser.parse(query);
|
82
93
|
|
83
|
-
//
|
84
|
-
let collector = TopDocs::with_limit(
|
94
|
+
// TODO: parametrize this magic constant
|
95
|
+
let collector = TopDocs::with_limit(1000);
|
85
96
|
|
86
97
|
let searcher = self.reader.searcher();
|
87
98
|
let matching_docs = searcher.search(&index_query, &collector)?;
|
@@ -92,6 +103,87 @@ impl RelationsReaderService {
|
|
92
103
|
)
|
93
104
|
}
|
94
105
|
|
106
|
+
fn paths_graph_search(
|
107
|
+
&self,
|
108
|
+
query: &nidx_protos::graph_query::PathQuery,
|
109
|
+
top_k: usize,
|
110
|
+
) -> anyhow::Result<GraphSearchResponse> {
|
111
|
+
let query = BoolGraphQuery::try_from(query)?;
|
112
|
+
let parser = GraphQueryParser::new();
|
113
|
+
let index_query = parser.parse_bool(query);
|
114
|
+
|
115
|
+
let collector = TopDocs::with_limit(top_k);
|
116
|
+
let searcher = self.reader.searcher();
|
117
|
+
let matching_docs = searcher.search(&index_query, &collector)?;
|
118
|
+
self.build_graph_response(
|
119
|
+
&searcher,
|
120
|
+
matching_docs.into_iter().map(|(_score, doc_address)| doc_address),
|
121
|
+
)
|
122
|
+
}
|
123
|
+
|
124
|
+
fn nodes_graph_search(
|
125
|
+
&self,
|
126
|
+
query: &nidx_protos::graph_query::PathQuery,
|
127
|
+
top_k: usize,
|
128
|
+
) -> anyhow::Result<GraphSearchResponse> {
|
129
|
+
let query = BoolNodeQuery::try_from(query)?;
|
130
|
+
let parser = GraphQueryParser::new();
|
131
|
+
let (source_query, destination_query) = parser.parse_bool_node(query);
|
132
|
+
|
133
|
+
let mut unique_nodes = HashSet::new();
|
134
|
+
|
135
|
+
let collector = TopUniqueNodeCollector::new(NodeSelector::SourceNodes, top_k);
|
136
|
+
let searcher = self.reader.searcher();
|
137
|
+
let mut source_nodes = searcher.search(&source_query, &collector)?;
|
138
|
+
unique_nodes.extend(source_nodes.drain());
|
139
|
+
|
140
|
+
let collector = TopUniqueNodeCollector::new(NodeSelector::DestinationNodes, top_k);
|
141
|
+
let searcher = self.reader.searcher();
|
142
|
+
let mut destination_nodes = searcher.search(&destination_query, &collector)?;
|
143
|
+
unique_nodes.extend(destination_nodes.drain());
|
144
|
+
|
145
|
+
let nodes = unique_nodes
|
146
|
+
.into_iter()
|
147
|
+
.map(|(value, node_type, node_subtype)| RelationNode {
|
148
|
+
value,
|
149
|
+
ntype: node_type,
|
150
|
+
subtype: node_subtype,
|
151
|
+
})
|
152
|
+
.take(top_k)
|
153
|
+
.collect();
|
154
|
+
|
155
|
+
let response = nidx_protos::GraphSearchResponse {
|
156
|
+
nodes,
|
157
|
+
..Default::default()
|
158
|
+
};
|
159
|
+
Ok(response)
|
160
|
+
}
|
161
|
+
|
162
|
+
fn relations_graph_search(
|
163
|
+
&self,
|
164
|
+
query: &nidx_protos::graph_query::PathQuery,
|
165
|
+
top_k: usize,
|
166
|
+
) -> anyhow::Result<GraphSearchResponse> {
|
167
|
+
let query = BoolGraphQuery::try_from(query)?;
|
168
|
+
let parser = GraphQueryParser::new();
|
169
|
+
let index_query = parser.parse_bool(query);
|
170
|
+
|
171
|
+
let collector = TopUniqueRelationCollector::new(top_k);
|
172
|
+
let searcher = self.reader.searcher();
|
173
|
+
let matching_docs = searcher.search(&index_query, &collector)?;
|
174
|
+
|
175
|
+
let relations = matching_docs
|
176
|
+
.into_iter()
|
177
|
+
.map(|doc| io_maps::doc_to_graph_relation(&self.schema, &doc))
|
178
|
+
.collect();
|
179
|
+
|
180
|
+
let response = nidx_protos::GraphSearchResponse {
|
181
|
+
relations,
|
182
|
+
..Default::default()
|
183
|
+
};
|
184
|
+
Ok(response)
|
185
|
+
}
|
186
|
+
|
95
187
|
fn build_graph_response(
|
96
188
|
&self,
|
97
189
|
searcher: &Searcher,
|
@@ -133,22 +225,6 @@ impl RelationsReaderService {
|
|
133
225
|
};
|
134
226
|
Ok(response)
|
135
227
|
}
|
136
|
-
|
137
|
-
pub fn inner_graph_search(&self, query: GraphQuery) -> anyhow::Result<nidx_protos::GraphSearchResponse> {
|
138
|
-
let parser = GraphQueryParser::new();
|
139
|
-
let index_query: Box<dyn Query> = parser.parse(query);
|
140
|
-
|
141
|
-
// TODO: parametrize this magic constant
|
142
|
-
let collector = TopDocs::with_limit(1000);
|
143
|
-
|
144
|
-
let searcher = self.reader.searcher();
|
145
|
-
let matching_docs = searcher.search(&index_query, &collector)?;
|
146
|
-
|
147
|
-
self.build_graph_response(
|
148
|
-
&searcher,
|
149
|
-
matching_docs.into_iter().map(|(_score, doc_address)| doc_address),
|
150
|
-
)
|
151
|
-
}
|
152
228
|
}
|
153
229
|
|
154
230
|
impl RelationsReaderService {
|
@@ -13,7 +13,7 @@ classifiers = [
|
|
13
13
|
"Programming Language :: Python :: Implementation :: CPython",
|
14
14
|
"Programming Language :: Python :: Implementation :: PyPy",
|
15
15
|
]
|
16
|
-
version = "6.3.3.
|
16
|
+
version = "6.3.3.post96"
|
17
17
|
|
18
18
|
[project.urls]
|
19
19
|
Homepage = "https://nuclia.com"
|