我为PDF文档实现了一个简单的添加工具.我首先创建所有文档的主文档(SolrInputDocument).它获取了诸如author,filehash,keywords,'content_type = document'等字段.
之后我为每个页面生成一个SolrInputDocument,该对象获得一个像'parentID_p01'的id,该页面作为字段值,'content_type = page'usw.
最后,我使用addChildDocument()将所有页面文档添加到我的主文档中.
现在我的问题是,如何在所有文档的所有页面中搜索给定的单词,例如:
Document1.pdf 'this is my doc1 title' [2 matches]
[Page 14] 'Example phrase for special a <em>word</em> given by....
[Page 55] 'another <em>word</em> for this test
Document2.pdf 'doc2 title' [X matches]
[Page 1] 'given <em>word</em> in this text
[Page 2] '<em>words</em> hit more than fists
[Page 99] 'some <em>words</em> of wisdom
Run Code Online (Sandbox Code Playgroud)
我的第一个想法是用' text:word~ ' 进行简单搜索然后按父文档分组,但我找不到一个好方法:-(
似乎嵌套文档对solr来说有点新,我没有找到SolrJ的简单解决方案.
提前致谢
我遵循了一些像这样的教程:
让 i18n 在我的 spring(boot) 项目中工作。到目前为止它正在工作,但我不喜欢它总是将MessageSourcebean 自动连接到我当前的类,只是为了String翻译一些 s 。
我的想法是一个简单的包装类,带有静态调用,例如
I18n.translate("some.identifier")
Run Code Online (Sandbox Code Playgroud)
或者
I18n.translate("some.identifier",param,param,param...).
Run Code Online (Sandbox Code Playgroud)
但我不能将其注入MessageSource到Spring不处理的类中,对吧?
知道如何解决这个问题吗?
我必须谈谈Yesod(简单).是的,..我从来没有或真的很少使用haskell.大学讲师.....呵呵.
所以我读了一本关于yesod的书,在一些章节中,作者正在使用像<$>和的一些运算符<*>.有人可以用简单的话来解释,这个运营商做了什么?很难谷歌为那些字符和如果试图阅读Control.Applicative的文档,但说实话,它很难得到一个haskell初学者.
所以我希望任何人都有一个简单的答案:)
使用这些运算符的书的示例:
......
personForm :: Html -> MForm Handler (FormResult Person, Widget)
personForm = renderDivs $ Person
<$> areq textField "Name" Nothing
<*> areq (jqueryDayField def
{ jdsChangeYear = True -- give a year dropdown
, jdsYearRange = "1900:-5" -- 1900 till five years ago
}) "Birthday" Nothing
<*> aopt textField "Favorite color" Nothing
<*> areq emailField "Email address" Nothing
<*> aopt urlField "Website" Nothing
data Person = Person
{ personName :: Text
, …Run Code Online (Sandbox Code Playgroud) 我开始了一个小型的新项目,我想从XML反序列化对象.
我创建了一个xsd:
和一个示例XML文件:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<hdb>
<country code="DE">
<variableHoliday daysAfterEaster="49" name="PENTECOAST" />
<fixedHoliday month="JANUARY" day="1" name="NEWYEAR" />
<region code="sa">
<fixedHoliday month="APRIL" day="1" name="FUNNYDAY" />
<variableHoliday daysAfterEaster="0" name="EASTERSUNDAY" />
</region>
<region code="ba">
<variableHoliday daysAfterEaster="12" name="CORPUSCHRISTI" />
</region>
</country>
<country code="US">
<fixedHoliday month="JULY" day="4" name="INDEPENDENCEDAY" />
</country>
<country code="AL">
<fixedHoliday month="JULY" day="4" name="INDEPENDENCEDAY" />
</country>
</hdb>
Run Code Online (Sandbox Code Playgroud)
哪个应该使用xsd等.
那么我怎样才能将这些XML的反序列化转化为一个漂亮的Java-Object Structure呢?
Mabe喜欢:
class HDB {
private HashMap<CountryCode,Country> map;
}
class Country {
private List<Holiday> list; // or two Lists with <variableHoliday> …Run Code Online (Sandbox Code Playgroud) 只是一个愚蠢的问题,但很难搜索,因为关于 Eclipse 自动完成的主题太多了,而且很难找到与我的问题匹配的内容。
所以问题是:
如果我写:“MyClass MyVarName”然后点击空格,(添加“= new MyClass()”)Eclipse会自动添加:“MyClass MyVarName_ MyClass ”或类似的东西到变量名.....(只是没有下划线.... stackoverflow 只是不会标记为粗体...)
那真的很烦人,而且因为我导入了同事的eclipse配置......我真的不知道如何禁用......
提前致谢
//编辑:
它似乎与我输入“MyC”然后按空格的效果相同,它还完成了“MyClass”而不是仅添加空格......就像按回车键一样。但我不想在空间上自动完成...
我也没有在空间上找到自定义键选项,否则...... :(
这里我在R的问题:
mtable <- read.table(paste(".folder_1362704682.4574","/groups.txt",sep=""),sep="\t",comment.char='',skip=0, header=TRUE, fill=TRUE,check.names=FALSE)
Run Code Online (Sandbox Code Playgroud)
第一个文件夹部分或paste()通常由var包装,用于调试目的 - > static.
我总是得到这样的信息:
Error in read.table(paste(".frunc_1362704682.4574", "/groups.txt", sep = ""), :
duplicate 'row.names' are not allowed
Run Code Online (Sandbox Code Playgroud)
但是,如果我查看带有此标题的文件:
root_node_name node_name node_id #genes_in_root_node #genes_in_node #genes_with_variable=1_in_root_node #genes_with_variable=1_in_node raw_p_underrepresentation_of_variable=1 raw_p_overrepresentation_ of_variable=1 FWER_underrepresentation FWER_overrepresentation FDR_underrepresentation FDR_overrepresentation
Run Code Online (Sandbox Code Playgroud)
我看不到任何重复.. :(我在另一个关于我应该尝试的讨论中读到:
mtable <- read.table(paste(".frunc_1362704682.4574","/groups.txt",sep=""),sep="\t",comment.char='',skip=0, header=TRUE, fill=TRUE,check.names=FALSE,**row.names=NULL**)
Run Code Online (Sandbox Code Playgroud)
这很好用,但之后所有标题都向右移了一列:
> head(mtable, n=1)
row.names root_node_name node_name
1 molecular_function trans-hexaprenyltranstransferase activity GO:0000010
node_id #genes_in_root_node #genes_in_node
1 17668 2 2419
#genes_with_variable=1_in_root_node #genes_with_variable=1_in_node
1 0 0.74491
raw_p_underrepresentation_of_variable=1
1 1
raw_p_overrepresentation_of_variable=1 FWER_underrepresentation
1 1 1
FWER_overrepresentation FDR_underrepresentation …Run Code Online (Sandbox Code Playgroud)