首页 \ 问答 \ SOLR 5在生产环境中安装(SOLR 5 Install in a Production Environment)

SOLR 5在生产环境中安装(SOLR 5 Install in a Production Environment)

我对安装SOLR 5.5有点困惑。 5.5手册说不建议在任何其他Web /应用程序servlet容器上部署solr war。 它说部署solr作为一个独立的服务器。 这是什么意思? 在8983端口上运行的SOLR没有用完码头? SOLR本身是一个Web服务器? 在生产环境中它会有多稳定?

我按照https://cwiki.apache.org/confluence/display/solr/Installing+Solr https://cwiki.apache.org/confluence/display/solr/Taking+Solr+to+Production上的所有说明进行操作

感谢有人可以分享他们的经验。


I am a bit confused about installing SOLR 5.5. The 5.5 manual says it is not recommended to deploy solr war on any other web/application servlet containers. It says deploy solr as a stand alone server. What does this mean? SOLR running on port 8983 is not running out of jetty? SOLR itself is a web server? How stable will it be in a prod environment?

I followed all the instructions on https://cwiki.apache.org/confluence/display/solr/Installing+Solr https://cwiki.apache.org/confluence/display/solr/Taking+Solr+to+Production

Appreciate if someone can share their experience.


原文:https://stackoverflow.com/questions/36491582
更新时间:2022-04-03 19:04

最满意答案

在上传成功时,dropzone会在div中使用类dz-success添加已上传元素的预览,如果存在该元素,则可以检查每个表单,一种方法可以使用jQuery的函数:

function checkForm() {
  var valid = true;
  if ($.trim($('input[name=your_name]').val()) === '') {
    valid = false;
  }
  $('form.dropzone').each(function() {
    if ($(this).find('.dz-success').length === 0) {
      valid = false;
    }
  });
  if (valid) {
    $('button[disabled=True]').removeAttr('disabled');
  }
};

然后在dropzone表单的初始化中,您可以在成功事件上添加一个事件侦听器,该事件调用函数来检查init选项中的表单,当您手动初始化dropzone时,需要将auto discover选项设置为false。

init 文档

是Dropzone初始化时调用的函数。 您可以在此函数中设置事件侦听器。

根据文档success事件在以下情况下触发:

该文件已成功上传。 获取服务器响应作为第二个参数。 (此事件之前被称为完成)

Dropzone.autoDiscover = false;
$(".dropzone").each( function(){
    $(this).dropzone({
        init: function() {
            this.on("success", function() { 
                checkForm();
            });
        }
    });
});

您还可以通过将验证功能添加到完整选项来调用验证功能。

根据文件

上传成功或错误时调用Complete。

Dropzone.autoDiscover = false;
$(".dropzone").each(function() {
  $(this).dropzone({
    complete: function(file) {
      if (file.status == "success") {
        checkForm();
      }
    }
  });
});

有关配置选项的更多信息: http//www.dropzonejs.com/#configuration

您可以在runnable中看到它在这里工作:

http://code.runnable.com/VgWdDZgLJkUGaepA/dropzone-success-event-for-php


On upload success dropzone adds the preview of the uploaded element inside a div with the class dz-success, you can check for every form if exists that element, one way can be with a function using jQuery:

function checkForm() {
  var valid = true;
  if ($.trim($('input[name=your_name]').val()) === '') {
    valid = false;
  }
  $('form.dropzone').each(function() {
    if ($(this).find('.dz-success').length === 0) {
      valid = false;
    }
  });
  if (valid) {
    $('button[disabled=True]').removeAttr('disabled');
  }
};

Then on the initialization of the dropzone form you can add an event listener on the success event that calls the function to check the form in the init option, when you initialize dropzone manually you need to set auto discover option to false.

init documentation:

is a function that gets called when Dropzone is initialized. You can setup event listeners inside this function.

According to the documentation the success event is triggered when:

The file has been uploaded successfully. Gets the server response as second argument. (This event was called finished previously)

Dropzone.autoDiscover = false;
$(".dropzone").each( function(){
    $(this).dropzone({
        init: function() {
            this.on("success", function() { 
                checkForm();
            });
        }
    });
});

You also can call the validation function by adding it to the complete option.

According to the documentation:

Complete is called when the upload was either successful or erroneous.

Dropzone.autoDiscover = false;
$(".dropzone").each(function() {
  $(this).dropzone({
    complete: function(file) {
      if (file.status == "success") {
        checkForm();
      }
    }
  });
});

more on configuration options: http://www.dropzonejs.com/#configuration

You can see it working here in runnable:

http://code.runnable.com/VgWdDZgLJkUGaepA/dropzone-success-event-for-php

相关问答

更多
  • 由于您无法发布与上传者相关的完整代码,因此无法根据您的上传器为您提供解决方案。 但是,如果你理解下面的代码,你将能够实现你想要的。 this.on("complete", function (file) { if (this.getUploadingFiles().length === 0 && this.getQueuedFiles().length === 0) { // Some options to hide the Container or Modal $( ...
  • 问题是Dropzone会在您删除文件时自动POST。 但它不包含请求POST中的任何其他字段 - 只是文件。 所以你的CSRF令牌丢失了(就像你表单上的所有其他字段一样),Laravel会抛出一个错误。 有几种方法可以解决这个问题。 也许最简单的方法是将CSRF令牌添加到sending()甚至处理程序中发布的数据中。 Dropzone文档甚至提到了这样做 : ...你可以修改它们(例如添加一个CSRF令牌)... 所以,在你的代码中: // First, include the 2nd and 3rd pa ...
  • 你需要: 添加一个按钮: 告诉Dropzone不要在放下文件时上传文件。 这是用autoProcessQueue配置选项完成的 : autoProcessQueue: false 由于Dropzone不会自动上传文件,因此您需要手动指示它在单击按钮时执行此操作。 所以你需要一个按钮点击的事件处理程序: $("#button").click(function ...
  • 我不在我的开发计算机上,所以我无法尝试,但有两件事可能会有所帮助。 1)你想作为dropzone热点的div不应该有class dropzone。 它需要类dz-message。 写这样:
    2)如果您不希望它自动将文件发送到服务器,则需要在Dropzone.options对象中添加autoProcessQueue ...
  • 我想你想让你的按钮有可点击的选项,不是吗? 如果是这样,你应该像这样配置你的Dropzone: Dropzone.options.validationForm = { clickable: "#your_button_id", //rest of your code } 如果它不是你正在寻找的答案,也许你可以尝试更好地解释你想要的或者放入代码片段:) I guess you want your button to have the clickable option, isn't it? If so ...
  • 您可以像处理任何其他多部分表单一样处理Dropzone帖子。 以下是我的进展方式: @login_required @usertype_required def upload_picture(request, uid=None): """ Photo upload / dropzone handler :param request: :param uid: Optional picture UID when re-uploading a file. :return: ...
  • 在上传成功时,dropzone会在div中使用类dz-success添加已上传元素的预览,如果存在该元素,则可以检查每个表单,一种方法可以使用jQuery的函数: function checkForm() { var valid = true; if ($.trim($('input[name=your_name]').val()) === '') { valid = false; } $('form.dropzone').each(function() { if ($(th ...
  • 祝你好运 @{ }
    @section Styles{
    您可以在所有ajax之前使用$ .ajaxPrefilter()并将其添加到数据选项csrf标记中的所有ajax。 在此之后,您可以在数据数组csrf数据中进行典型的ajax请求,而无需声明 // for CI 3.0.4 data: {"security->get_csrf_token_name() ?>": "security->get_csrf_hash() ?>"} You can use $.ajaxPrefilter() before you all ...
  • 初始化dropzone实例时,需要将autoQueue属性设置为false: var formData = new FormData(); //On addedfile: Dropzone.options.myAwesomeDropzone = { autoQueue: false, init: function() { this.on("addedfile", function(file) { formData.append("file", file); }); ...

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)