-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Introduce
@Fulltext
annotation for creating fulltext indexes. (…
…#1183) Co-authored-by: Michael Simons <michael@simons.ac>
- Loading branch information
1 parent
802be95
commit 09a6454
Showing
12 changed files
with
173 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...essing/catalog/src/main/java/ac/simons/neo4j/migrations/annotations/catalog/Fulltext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright 2020-2023 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package ac.simons.neo4j.migrations.annotations.catalog; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* @author shanon84 | ||
* @since 2.8.2 | ||
*/ | ||
@Retention(RetentionPolicy.CLASS) | ||
@Target({ElementType.TYPE, ElementType.FIELD}) | ||
@Documented | ||
public @interface Fulltext { | ||
/** | ||
* If this is not {@literal null} it has precedence over an implicit label (either no class annotations or one without | ||
* a dedicated label) but not over OGM or SDN6 annotations specifying the label or type explicitly. | ||
* Its use must be consistent throughout the class. | ||
* | ||
* @return The target label | ||
*/ | ||
String label() default ""; | ||
|
||
/** | ||
* Use this if you want to define composite, fulltext index when using {@link Fulltext} on the class level. | ||
* Leave it empty when using on field level, otherwise an exception will be thrown. | ||
* | ||
* @return The list of properties to include in the composite. | ||
*/ | ||
String[] properties() default {}; | ||
|
||
/** | ||
* Use this if you want to use a different fulltext analyzer for your index. | ||
* Be aware to activate the option to allow further options on index creation. | ||
* | ||
* @return name of the fulltext analyzer | ||
*/ | ||
String analyzer() default ""; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...ava/ac/simons/neo4j/migrations/annotations/proc/catalog/invalid/ContradictingLabels3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright 2020-2023 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package ac.simons.neo4j.migrations.annotations.proc.catalog.invalid; | ||
|
||
import ac.simons.neo4j.migrations.annotations.catalog.Fulltext; | ||
|
||
/** | ||
* @author Michael J. Simons | ||
*/ | ||
@Fulltext(properties = {"nameA"}) | ||
public class ContradictingLabels3 { | ||
|
||
@Fulltext(label = "foo") | ||
public String name; | ||
|
||
public String nameA; | ||
} |
27 changes: 27 additions & 0 deletions
27
...mons/neo4j/migrations/annotations/proc/catalog/invalid/FulltextOnFieldWithProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright 2020-2023 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package ac.simons.neo4j.migrations.annotations.proc.catalog.invalid; | ||
|
||
import ac.simons.neo4j.migrations.annotations.catalog.Fulltext; | ||
|
||
/** | ||
* @author Michael J. Simons | ||
*/ | ||
public class FulltextOnFieldWithProperties { | ||
|
||
@Fulltext(properties = {"a", "b"}) | ||
public String name; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters