我试图将RecyclerView和CardView添加到我的项目中
dependencies {
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:support-v13:21.0.0'
compile 'com.android.support:cardview-v7:21.0.0'
compile 'com.android.support:recyclerview-v7:21.0.0'
compile 'com.viewpagerindicator:library:2.4.1@aar'
compile project(':facebook')
}
Run Code Online (Sandbox Code Playgroud)
它编译,但我在设备上运行时遇到异常
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.RecyclerView" on path: DexPathList[[zip file "/data/app/xxxx.apk"],nativeLibraryDirectories=[/data/app-lib/xxxx, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.view.LayoutInflater.createView(LayoutInflater.java:559)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:652)
Run Code Online (Sandbox Code Playgroud) 我有一个文件就像一个数组
DOC1
{
"item_type":"bag",
"color":["red","blue","green","orange"]
}
Run Code Online (Sandbox Code Playgroud)
DOC2
{
"item_type":"shirt",
"color":["red"]
}
Run Code Online (Sandbox Code Playgroud)
当我进行multi_match搜索时
{
"query": {
"multi_match": {
"query": "red bag",
"type": "cross_fields",
"fields": ["item_type","color"]
}
}
}
doc2的得分要高得多,我明白,如果我在doc1中有更多的颜色,那么颜色就越少得分越高.
那么有没有一种方法可以让Elasticsearch为数组字段评分相同,无论有多少项?