-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: using indexes to query post lists
- Loading branch information
Showing
36 changed files
with
526 additions
and
1,289 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
13 changes: 12 additions & 1 deletion
13
api/src/main/java/run/halo/app/extension/router/selector/FieldSelector.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 |
---|---|---|
@@ -1,15 +1,26 @@ | ||
package run.halo.app.extension.router.selector; | ||
|
||
import java.util.Objects; | ||
import org.springframework.lang.NonNull; | ||
import org.springframework.util.Assert; | ||
import run.halo.app.extension.index.query.Query; | ||
import run.halo.app.extension.index.query.QueryFactory; | ||
|
||
public record FieldSelector(Query query) { | ||
public record FieldSelector(@NonNull Query query) { | ||
public FieldSelector(Query query) { | ||
this.query = Objects.requireNonNullElseGet(query, QueryFactory::all); | ||
} | ||
|
||
public static FieldSelector of(Query query) { | ||
return new FieldSelector(query); | ||
} | ||
|
||
public static FieldSelector all() { | ||
return new FieldSelector(QueryFactory.all()); | ||
} | ||
|
||
public FieldSelector andQuery(Query other) { | ||
Assert.notNull(other, "Query must not be null"); | ||
return of(QueryFactory.and(query(), other)); | ||
} | ||
} |
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
129 changes: 0 additions & 129 deletions
129
application/src/main/java/run/halo/app/content/DefaultIndexer.java
This file was deleted.
Oops, something went wrong.
79 changes: 0 additions & 79 deletions
79
application/src/main/java/run/halo/app/content/Indexer.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.