Skip to content

Commit

Permalink
add path query
Browse files Browse the repository at this point in the history
  • Loading branch information
madneal committed Nov 18, 2017
1 parent 1d3e5ae commit 2f8bb50
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 5 deletions.
4 changes: 1 addition & 3 deletions search/src/main/java/constants/CommonConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ public class CommonConstants {
public static List<String> DOCFILES = new ArrayList<String>(Arrays.asList(
"doc", "docx", "xls", "xlsx", "pdf", "txt"
));
public static List<String> EXCLUDE_FILE_PATHS = new ArrayList<String>(Arrays.asList(
"node_modules"
));
public static List<String> EXCLUDE_FILE_PATHS;
public static boolean IS_OPEN_CONTEXT = true;
public static String INDEX_FILE_PATH = "index";
public static String TOTAL_FILE_NUM;
Expand Down
2 changes: 1 addition & 1 deletion search/src/main/java/index/BaseIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ private static void indexDocs(IndexWriter writer, List<FileBean> t) throws Excep
private static void indexDoc(IndexWriter writer, FileBean t) throws Exception {
Document doc = new Document();
if (t.getContent() != null) {
doc.add(new StringField(LuceneConstants.PATH, t.getFilepath(), Field.Store.YES));
doc.add(new TextField(LuceneConstants.PATH, t.getFilepath(), Field.Store.YES));
doc.add(new LongPoint(LuceneConstants.MODIFIED, t.getLastModified()));
doc.add(new TextField(LuceneConstants.CONTENT, t.getContent(), CommonConstants.IS_OPEN_CONTEXT ? Field.Store.YES : Field.Store.NO));
System.out.println("added to document:" + t.getFilepath());
Expand Down
2 changes: 1 addition & 1 deletion search/src/main/java/search/SearchedResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ public String getContext() {
public void setContext(String context) {
this.context = context;
}

}
Binary file modified search/target/classes/constants/CommonConstants.class
Binary file not shown.
Binary file modified search/target/classes/index/BaseIndex.class
Binary file not shown.
Binary file modified search/target/classes/search/SearchUtil.class
Binary file not shown.
Binary file modified search/target/classes/search/SearchedResult.class
Binary file not shown.
2 changes: 2 additions & 0 deletions ui/src/main/java/controller/Controller.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package controller;

import client.ClientWindow;
import constants.CommonConstants;
import constants.LuceneConstants;
import index.IndexUtil;
import javafx.application.ConditionalFeature;
Expand Down Expand Up @@ -80,6 +81,7 @@ protected Void call() throws Exception {

private void executeIndex() {
ConfigSetting configSetting = ConfigController.readConfig();
CommonConstants.EXCLUDE_FILE_PATHS = configSetting.getExcludeFilePathList();
IndexUtil.executeIndex(configSetting.getSearchMethod());
if (configSetting.getHasCreateIndex() == false) {
configSetting.setHasCreateIndex(true);
Expand Down

0 comments on commit 2f8bb50

Please sign in to comment.