如何在Apache Solr中创建复合键字段?(How to create a composite Key Field in Apache Solr?)
我有一个Apache Solr 3.5设置,它有一个像这样的SchemaXml:
<field name="appid" type="string" indexed="true" stored="true" required="true"/> <field name="docid" type="string" indexed="true" stored="true" required="true"/>
我需要的是一个将它们连接在一起并将其用作
<uniqueKey>
的字段。 似乎没有内置,没有创建多值id
字段和使用<copyField>
,但似乎uniqueKey需要单值字段。我需要这个的唯一原因是允许客户盲目地发出
<add>
调用,并让Solr弄清楚它是否是添加或更新。 因此,我不太关心ID的样子。我想我必须编写自己的Analyzer或Tokenizer? 我刚刚开始学习Solr,所以我不能100%确定我真正需要的东西,并且会欣赏我需要实现的任何提示。
I have an Apache Solr 3.5 setup that has a SchemaXml like this:
<field name="appid" type="string" indexed="true" stored="true" required="true"/> <field name="docid" type="string" indexed="true" stored="true" required="true"/>
What I would need is a field that concatenates them together and uses that as
<uniqueKey>
. There seems nothing built-in, short of creating a multi-valuedid
field and using<copyField>
, but it seems uniqueKey requires a single-valued field.The only reason I need this is to allow clients to blindly fire
<add>
calls and have Solr figure out if it's an addition or update. Therefore, I don't care too much how the ID looks like.I assume I would have to write my own Analyzer or Tokenizer? I'm just starting out learning Solr, so I'm not 100% sure what I'd actually need and would appreciate any hints towards what I need to implement.
原文:https://stackoverflow.com/questions/9775143
最满意答案
根据文档https://developer.android.com/google/play/billing/billing_reference.html :
purchaseState - 订单的购买状态。 它总是返回0(购买)。
我记得,以前也有其他的价值:
1 (canceled) 2 (refunded)
但我无法在文档上找到最新版本的参考。
According to the docs https://developer.android.com/google/play/billing/billing_reference.html:
purchaseState - The purchase state of the order. It always returns 0 (purchased).
As I remember, previously there were also the other values:
1 (canceled) 2 (refunded)
but I can't find the reference on the last version on the docs.
相关问答
更多-
Billing API v3 IabHelper NullPointerException(Billing API v3 IabHelper NullPointerException)[2023-08-28]
编辑4/15:在IabHelper中捕捉nullpointer似乎已经停止了这个问题。 我不再看到异常被抛出,我将接受这个答案。 编辑4/04:一点点深入潜水。 对于queryPurchases方法,尝试处理RemoteExceptions和JSONExceptions的catch块,但是没有NullPointerException处理。 我要尝试的是包括NullPointer异常处理,所以IabHelper在尝试查询SQLDetails时看起来像这样: catch (NullPointerExce ... -
这里: adFree = true; 关闭adFree变量值后,用户再次打开应用程序时会出现问题。 购买成功时,通过更新SharedPreferences状态来执行此操作: ... }else if (purchase.getSku().equals(ITEM_SKU)) { //save value in SharedPreferences here prefs.edit().putBoolean("adFree", true).commit(); } 并在onCre ...
-
IabHelper只是一个应用程序内Billing V3 API的包装器。 它旨在使事情变得更容易。 您不必使用它,因此不必使用IabHelper执行验证。 IabHelper is just a wrapper around In-app Billing V3 API. It's designed to make things easier. You don't have to use it, so it's not mandatory to perform verification using IabH ...
-
你有方法queryIntentServicesAsUser()的代码吗? 仔细观察后,看起来你发送queryIntentServices的变量之一可能是导致NullPointer。 I finally found a user getting a null intent who was not doing anything dodgy with in-app purchases. He was on kitkat. The fix was this: if (OSUtils.lollipopOrHigher ...
-
使用SharedPreferences解决了这个问题。 SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0); boolean isAdsDisabled = settings.getBoolean("isAdsDisabled", false); if (isAdsDisabled) { AdView adView = (AdView) this.findViewById( ...
-
正确答案为: 你可以使用任何你拥有的账户。 但请记住一件事情,即使用注册设备中的一个帐户(第一次启动设备时设置Google帐户),因为要测试应用程序,只有测试帐户用户可以购买产品,直到它不会发布(在Google Play市场中)。 ANSWER2: 其他用户可以在您的应用程序发布时看到您的产品。 您正在上传带有产品ID和base 64密钥的已签名的apk文件,以确认它是您的应用程序和Play商店的特定产品ID。 所以当其他任何用户购买该产品时,他的Google帐户将被注册为购买的产品。 编辑: 还有一件事你 ...
-
什么是IabHelper中的Purchase.getPurchaseState()?(What is Purchase.getPurchaseState() in IabHelper?)[2022-06-14]
根据文档https://developer.android.com/google/play/billing/billing_reference.html : purchaseState - 订单的购买状态。 它总是返回0(购买)。 我记得,以前也有其他的价值: 1 (canceled) 2 (refunded) 但我无法在文档上找到最新版本的参考。 According to the docs https://developer.android.com/google/play/billing/billing ... -
从我的海关清单视图适配器访问IabHelper的最佳方式(best way to access IabHelper from my customs list view adapter)[2021-09-13]
尝试使用界面,我这样做: 在适配器中创建接口: public interface IABHelperProvider { public IabHelper getHelper(); } 然后将它实现到main活动并覆盖方法getHelper(): @Override public IabHelper getHelper() { // TODO Auto-generated method stub return mHelper; } 并在适配器中调用它 mHelper = ((IA ... -
草稿状态的APK不再适用于测试应用内结算。 您需要在alpha或beta频道中发布它。 参考: http : //developer.android.com/google/play/billing/billing_testing.html#draft_apps APKs in draft status do no longer work for testing in-app billing. You need to release it in the alpha or beta channel. Refer ...
-
我什么时候需要IabHelper Class来购买InApp?(When do i need the IabHelper Class for making an InApp purchase?)[2021-10-21]
你是对的,考虑到IABHelper,指南有点令人困惑。 基本上,IAB-Helper是由Google员工编写的助手级,可以完成很多繁重工作。 因此,如果您使用IAB-Helper,则不必像在doPurchase()方法中那样编写尽可能多的代码。 您只需编写以下行: mHelper.launchPurchaseFlow(activity, sku, RC_REQUEST, mPurchaseFinishedListener); 购买后的东西也是如此,没有摆弄JSON对象 if (info.getSku(). ...