You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by GitBox <gi...@apache.org> on 2022/09/22 08:57:16 UTC
[GitHub] [lucenenet] chenhh021 opened a new issue, #644: Robustness issue in QuadPrefixTree
chenhh021 opened a new issue, #644:
URL: https://github.com/apache/lucenenet/issues/644
Hi,
when trying to index a point with coordinate (144502.06, 639062.07) in Lucene.Net.Spatial, a System.ArgumentOutOfRangeException is thrown out. The stack trace is listed below. This bug can be reproduced by [this test](https://github.com/apache/lucenenet/commit/956c78c9eed7548a1069f5633510c7aa351a9ad4).
`System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
Actual value was 0.
at J2N.Collections.Generic.List‘1.get_Item(Int32 index)
at Lucene.Net.Spatial.Prefix.Tree.QuadPrefixTree.GetCell(IPoint p, Int32 level) in D:\chh\SE\projects\lucenenet\src\Lucene.Net.Spatial\Prefix\Tree\QuadPrefixTree.cs:line 167
at Lucene.Net.Spatial.Prefix.Tree.SpatialPrefixTree.GetCells(IPoint p, Int32 detailLevel, Boolean inclParents) in D:\chh\SE\projects\lucenenet\src\Lucene.Net.Spatial\Prefix\Tree\SpatialPrefixTree.cs:line 286
at Lucene.Net.Spatial.Prefix.Tree.SpatialPrefixTree.GetCells(IShape shape, Int32 detailLevel, Boolean inclParents, Boolean simplify) in D:\chh\SE\projects\lucenenet\src\Lucene.Net.Spatial\Prefix\Tree\SpatialPrefixTree.cs:line 204
at Lucene.Net.Spatial.Prefix.PrefixTreeStrategy.CreateIndexableFields(IShape shape, Double distErr) in D:\chh\SE\projects\lucenenet\src\Lucene.Net.Spatial\Prefix\PrefixTreeStrategy.cs:line 139
at Lucene.Net.Spatial.Prefix.PrefixTreeStrategy.CreateIndexableFields(IShape shape) in D:\chh\SE\projects\lucenenet\src\Lucene.Net.Spatial\Prefix\PrefixTreeStrategy.cs:line 133
at Lucene.Net.Spatial.StrategyTestCase.newDoc(String id, IShape shape) in D:\chh\SE\projects\lucenenet\src\Lucene.Net.Tests.Spatial\StrategyTestCase.cs:line 220
at Lucene.Net.Spatial.StrategyTestCase.adoc(String id, IShape shape) in D:\chh\SE\projects\lucenenet\src\Lucene.Net.Tests.Spatial\StrategyTestCase.cs:line 211
at Lucene.Net.Spatial.RobustnessTest.QuadTreeRobustness() in D:\chh\SE\projects\lucenenet\src\Lucene.Net.Tests.Spatial\RobustnessTest.cs:line 46`
Configurations:
```c#
SpatialContextFactory test_factory = new SpatialContextFactory();
test_factory.IsGeo = false;
test_factory.WorldBounds = new Rectangle(0.0, 700000.0, 0.0, 650000.0, null);
SpatialContext ctx = new SpatialContext(test_factory);
SpatialPrefixTree grid; SpatialStrategy strategy;
grid = new QuadPrefixTree(ctx, 40);
strategy = new RecursivePrefixTreeStrategy(grid, "recursive_quad");
```
I am new to the community, please let me know if I did anything unproper. Thanks in advance!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [lucenenet] NightOwl888 commented on issue #644: Robustness issue in QuadPrefixTree
Posted by GitBox <gi...@apache.org>.
NightOwl888 commented on issue #644:
URL: https://github.com/apache/lucenenet/issues/644#issuecomment-1302485501
This is a duplicate of [LUCENE-8755(https://issues.apache.org/jira/browse/LUCENE-8755), and will be fixed when we upgrade to 8.3.0. For now, we will be sticking with the 4.8.0 behavior.
For those who wish to have a patch before then, the `AbstractPrefixTreeFilter` and `SpatialPrefixTree` are both abstract and the `QuadPrefixTree` is not sealed and all members are virtual so it can be extended to include the patch, if necessary.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [lucenenet] chenhh021 commented on issue #644: Robustness issue in QuadPrefixTree
Posted by GitBox <gi...@apache.org>.
chenhh021 commented on issue #644:
URL: https://github.com/apache/lucenenet/issues/644#issuecomment-1300594973
I find lucene ever fix the same bug via this [commit](https://github.com/apache/lucene/commit/26628b2717a73235db56fde94f7f5b64cbc5b8b2) . Although it was done for lucene 9.4, the changed code is shared by the present version of lucene.net.
I have created a [PR](https://github.com/apache/lucenenet/pull/738) mimic that commit. What I have done include:
1.Reimplement QuadPrefixTree's getCell method;
2. Add a version check so the older versions still use the older implementation.
Could anyone take a review?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [lucenenet] chenhh021 commented on issue #644: Robustness issue in QuadPrefixTree
Posted by GitBox <gi...@apache.org>.
chenhh021 commented on issue #644:
URL: https://github.com/apache/lucenenet/issues/644#issuecomment-1256877413
@NightOwl888 @rclabo could you please have a look at this problem?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [lucenenet] NightOwl888 closed issue #644: Robustness issue in QuadPrefixTree
Posted by GitBox <gi...@apache.org>.
NightOwl888 closed issue #644: Robustness issue in QuadPrefixTree
URL: https://github.com/apache/lucenenet/issues/644
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@lucenenet.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org